mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Enable scrollbar on the room list for macOS (#174)
This commit is contained in:
parent
069f0a1fbd
commit
8386dd73ce
4 changed files with 13 additions and 2 deletions
|
@ -45,6 +45,7 @@ PopupItem {
|
||||||
RoomList,
|
RoomList,
|
||||||
RoomList > * {
|
RoomList > * {
|
||||||
background-color: #2d3139;
|
background-color: #2d3139;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommunitiesList,
|
CommunitiesList,
|
||||||
|
|
|
@ -45,6 +45,7 @@ PopupItem {
|
||||||
RoomList,
|
RoomList,
|
||||||
RoomList > * {
|
RoomList > * {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommunitiesList,
|
CommunitiesList,
|
||||||
|
|
|
@ -70,6 +70,11 @@ RegisterPage {
|
||||||
background-color: palette(window);
|
background-color: palette(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RoomList,
|
||||||
|
RoomList > * {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
RoomInfoListItem {
|
RoomInfoListItem {
|
||||||
qproperty-highlightedBackgroundColor: palette(highlight);
|
qproperty-highlightedBackgroundColor: palette(highlight);
|
||||||
qproperty-hoverBackgroundColor: palette(light);
|
qproperty-hoverBackgroundColor: palette(light);
|
||||||
|
|
|
@ -34,18 +34,22 @@ RoomList::RoomList(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, userSettings_{userSettings}
|
, userSettings_{userSettings}
|
||||||
{
|
{
|
||||||
setStyleSheet("border: none;");
|
|
||||||
topLayout_ = new QVBoxLayout(this);
|
topLayout_ = new QVBoxLayout(this);
|
||||||
topLayout_->setSpacing(0);
|
topLayout_->setSpacing(0);
|
||||||
topLayout_->setMargin(0);
|
topLayout_->setMargin(0);
|
||||||
|
|
||||||
scrollArea_ = new QScrollArea(this);
|
scrollArea_ = new QScrollArea(this);
|
||||||
scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
scrollArea_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
||||||
scrollArea_->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
|
scrollArea_->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
|
||||||
scrollArea_->setWidgetResizable(true);
|
scrollArea_->setWidgetResizable(true);
|
||||||
scrollArea_->setAlignment(Qt::AlignLeading | Qt::AlignTop | Qt::AlignVCenter);
|
scrollArea_->setAlignment(Qt::AlignLeading | Qt::AlignTop | Qt::AlignVCenter);
|
||||||
|
|
||||||
|
// The scrollbar on macOS will hide itself when not active so it won't interfere
|
||||||
|
// with the content.
|
||||||
|
#if not defined(Q_OS_MAC)
|
||||||
|
scrollArea_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
#endif
|
||||||
|
|
||||||
scrollAreaContents_ = new QWidget(this);
|
scrollAreaContents_ = new QWidget(this);
|
||||||
|
|
||||||
contentsLayout_ = new QVBoxLayout(scrollAreaContents_);
|
contentsLayout_ = new QVBoxLayout(scrollAreaContents_);
|
||||||
|
|
Loading…
Reference in a new issue