Răsfoiți Sursa

UI: Use icons for hotkey buttons

Clayton Groeneveld 6 ani în urmă
părinte
comite
b2e0d93990

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

@@ -985,3 +985,11 @@ VisibilityCheckBox::indicator:checked:hover {
 VisibilityCheckBox::indicator:unchecked:hover {
     image: url(:res/images/invisible.svg);
 }
+
+* [themeID="trashIcon"] {
+    qproperty-icon: url(./Dark/trash.svg);
+}
+
+* [themeID="revertIcon"] {
+    qproperty-icon: url(./Dark/revert.svg);
+}

+ 8 - 0
UI/data/themes/Dark.qss

@@ -708,3 +708,11 @@ VisibilityCheckBox::indicator:checked {
 VisibilityCheckBox::indicator:unchecked {
     image: url(:res/images/invisible.svg);
 }
+
+* [themeID="trashIcon"] {
+    qproperty-icon: url(./Dark/trash.svg);
+}
+
+* [themeID="revertIcon"] {
+    qproperty-icon: url(./Dark/revert.svg);
+}

+ 1 - 0
UI/data/themes/Dark/revert.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#d2d2d2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-ccw"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>

+ 1 - 0
UI/data/themes/Dark/trash.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#d2d2d2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>

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

@@ -1339,3 +1339,11 @@ VisibilityCheckBox::indicator:checked:hover {
 VisibilityCheckBox::indicator:unchecked:hover {
     image: url(:res/images/invisible.svg);
 }
+
+* [themeID="trashIcon"] {
+    qproperty-icon: url(./Dark/trash.svg);
+}
+
+* [themeID="revertIcon"] {
+    qproperty-icon: url(./Dark/revert.svg);
+}

+ 8 - 0
UI/data/themes/System.qss

@@ -191,3 +191,11 @@ VisibilityCheckBox::indicator:checked {
 VisibilityCheckBox::indicator:unchecked {
     image: url(:res/images/invisible.svg);
 }
+
+* [themeID="trashIcon"] {
+    qproperty-icon: url(:res/images/trash.svg);
+}
+
+* [themeID="revertIcon"] {
+    qproperty-icon: url(:res/images/revert.svg);
+}

+ 1 - 0
UI/forms/images/revert.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-ccw"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>

+ 1 - 0
UI/forms/images/trash.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>

+ 2 - 0
UI/forms/obs.qrc

@@ -14,6 +14,8 @@
     <file>images/locked.svg</file>
     <file>images/invisible.svg</file>
     <file>images/visible.svg</file>
+    <file>images/trash.svg</file>
+    <file>images/revert.svg</file>
   </qresource>
   <qresource prefix="/settings">
     <file>images/settings/output.svg</file>

+ 14 - 10
UI/hotkey-edit.cpp

@@ -272,13 +272,17 @@ void OBSHotkeyWidget::AddEdit(obs_key_combination combo, int idx)
 	edit->setToolTip(toolTip);
 
 	auto revert = new QPushButton;
-	revert->setProperty("themeID", "hotkeyButtons");
-	revert->setText(QTStr("Revert"));
+	revert->setProperty("themeID", "revertIcon");
+	revert->setToolTip(QTStr("Revert"));
+	revert->setFixedSize(24, 24);
+	revert->setStyleSheet("background: transparent; border: none;");
 	revert->setEnabled(false);
 
 	auto clear = new QPushButton;
-	clear->setProperty("themeID", "hotkeyButtons");
-	clear->setText(QTStr("Clear"));
+	clear->setProperty("themeID", "trashIcon");
+	clear->setToolTip(QTStr("Clear"));
+	clear->setFixedSize(24, 24);
+	clear->setStyleSheet("background: transparent; border: none;");
 	clear->setEnabled(!obs_key_combination_is_empty(combo));
 
 	QObject::connect(edit, &OBSHotkeyEdit::KeyChanged,
@@ -289,15 +293,15 @@ void OBSHotkeyWidget::AddEdit(obs_key_combination combo, int idx)
 	});
 
 	auto add = new QPushButton;
-	add->setProperty("themeID", "hotkeyButtons");
-	add->setText("+");
-	add->setMinimumWidth(50);
+	add->setProperty("themeID", "addIconSmall");
+	add->setFixedSize(24, 24);
+	add->setStyleSheet("background: transparent; border: none;");
 
 	auto remove = new QPushButton;
-	remove->setProperty("themeID", "hotkeyButtons");
-	remove->setText("-");
+	remove->setProperty("themeID", "removeIconSmall");
 	remove->setEnabled(removeButtons.size() > 0);
-	remove->setMinimumWidth(50);
+	remove->setFixedSize(24, 24);
+	remove->setStyleSheet("background: transparent; border: none;");
 
 	auto CurrentIndex = [&, remove]
 	{