浏览代码

UI: Fix alignment of volume sliders

With the Yami themes, the volume sliders wouldn't
be aligned in the center of the layout.
cg2121 3 年之前
父节点
当前提交
193d48f5d9
共有 6 个文件被更改,包括 8 次插入28 次删除
  1. 0 4
      UI/data/themes/Acri.qss
  2. 0 4
      UI/data/themes/Grey.qss
  3. 0 4
      UI/data/themes/Light.qss
  4. 0 4
      UI/data/themes/Rachni.qss
  5. 0 4
      UI/data/themes/Yami.qss
  6. 8 8
      UI/volume-control.cpp

+ 0 - 4
UI/data/themes/Acri.qss

@@ -974,10 +974,6 @@ QHeaderView::section {
 
 
 /* Mute CheckBox */
 /* Mute CheckBox */
 
 
-MuteCheckBox {
-    margin: 4px 0px 0px;
-}
-
 MuteCheckBox::indicator:checked {
 MuteCheckBox::indicator:checked {
     image: url(./Dark/mute.svg);
     image: url(./Dark/mute.svg);
 }
 }

+ 0 - 4
UI/data/themes/Grey.qss

@@ -962,10 +962,6 @@ QHeaderView::section {
 
 
 /* Mute CheckBox */
 /* Mute CheckBox */
 
 
-MuteCheckBox {
-    margin: 4px 0px 0px;
-}
-
 MuteCheckBox::indicator:checked {
 MuteCheckBox::indicator:checked {
     image: url(./Dark/mute.svg);
     image: url(./Dark/mute.svg);
 }
 }

+ 0 - 4
UI/data/themes/Light.qss

@@ -962,10 +962,6 @@ QHeaderView::section {
 
 
 /* Mute CheckBox */
 /* Mute CheckBox */
 
 
-MuteCheckBox {
-    margin: 4px 0px 0px;
-}
-
 MuteCheckBox::indicator:checked {
 MuteCheckBox::indicator:checked {
     image: url(./Light/mute.svg);
     image: url(./Light/mute.svg);
 }
 }

+ 0 - 4
UI/data/themes/Rachni.qss

@@ -966,10 +966,6 @@ QHeaderView::section {
 
 
 /* Mute CheckBox */
 /* Mute CheckBox */
 
 
-MuteCheckBox {
-    margin: 4px 0px 0px;
-}
-
 MuteCheckBox::indicator:checked {
 MuteCheckBox::indicator:checked {
     image: url(./Dark/mute.svg);
     image: url(./Dark/mute.svg);
 }
 }

+ 0 - 4
UI/data/themes/Yami.qss

@@ -966,10 +966,6 @@ QHeaderView::section {
 
 
 /* Mute CheckBox */
 /* Mute CheckBox */
 
 
-MuteCheckBox {
-    margin: 4px 0px 0px;
-}
-
 MuteCheckBox::indicator:checked {
 MuteCheckBox::indicator:checked {
     image: url(./Dark/mute.svg);
     image: url(./Dark/mute.svg);
 }
 }

+ 8 - 8
UI/volume-control.cpp

@@ -248,7 +248,6 @@ VolControl::VolControl(OBSSource source_, bool showConfig, bool vertical)
 
 
 		setMaximumWidth(110);
 		setMaximumWidth(110);
 	} else {
 	} else {
-		QHBoxLayout *volLayout = new QHBoxLayout;
 		QHBoxLayout *textLayout = new QHBoxLayout;
 		QHBoxLayout *textLayout = new QHBoxLayout;
 		QHBoxLayout *botLayout = new QHBoxLayout;
 		QHBoxLayout *botLayout = new QHBoxLayout;
 
 
@@ -261,16 +260,17 @@ VolControl::VolControl(OBSSource source_, bool showConfig, bool vertical)
 		textLayout->setAlignment(nameLabel, Qt::AlignLeft);
 		textLayout->setAlignment(nameLabel, Qt::AlignLeft);
 		textLayout->setAlignment(volLabel, Qt::AlignRight);
 		textLayout->setAlignment(volLabel, Qt::AlignRight);
 
 
-		volLayout->addWidget(slider);
-		volLayout->addWidget(mute);
-		volLayout->setSpacing(5);
-
 		botLayout->setContentsMargins(0, 0, 0, 0);
 		botLayout->setContentsMargins(0, 0, 0, 0);
-		botLayout->setSpacing(0);
-		botLayout->addLayout(volLayout);
+		botLayout->setSpacing(5);
+		botLayout->addWidget(slider);
+		botLayout->addWidget(mute);
+		botLayout->setAlignment(slider, Qt::AlignVCenter);
+		botLayout->setAlignment(mute, Qt::AlignVCenter);
 
 
-		if (showConfig)
+		if (showConfig) {
 			botLayout->addWidget(config);
 			botLayout->addWidget(config);
+			botLayout->setAlignment(config, Qt::AlignVCenter);
+		}
 
 
 		mainLayout->addItem(textLayout);
 		mainLayout->addItem(textLayout);
 		mainLayout->addWidget(volMeter);
 		mainLayout->addWidget(volMeter);