Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverted Appearance Slider #360

Open
hmaarrfk opened this issue Dec 24, 2024 · 0 comments · May be fixed by #361
Open

Inverted Appearance Slider #360

hmaarrfk opened this issue Dec 24, 2024 · 0 comments · May be fixed by #361

Comments

@hmaarrfk
Copy link
Contributor

hmaarrfk commented Dec 24, 2024

The Qt Slider can have an inverted apperance.

However, QDarkstyle doesn't style it correctly:

We need a CSS that looks like:

QSlider::sub-page:horizontal[invertedAppearance=true], QSlider::sub-page:vertical[invertedAppearance=true] {
     background: rgb(108, 111, 112);
     border-radius: 2px;
}

xref:
https://github.com/aws/lumberyard/blob/master/dev/Code/Sandbox/Editor/Style/NewEditorStylesheet.qss#L1504

Describe Your Environment

* OPERATING SYSTEM---------------------------------------------------------------
    - System........................ Linux
    - Release....................... 6.11.4-301.fc41.x86_64
    - Platform...................... Linux-6.11.4-301.fc41.x86_64-x86_64-with-glibc2.40
    - Version....................... #1 SMP PREEMPT_DYNAMIC Sun Oct 20 15:02:33 UTC 2024
* PYTHON DISTRIBUTION------------------------------------------------------------
    - Version....................... 3.10.16
    - C Compiler.................... GCC 13.3.0
    - C API Version................. 1013
    - Implementation................ cpython
    - Implementation Version........ 3.10.16
* QT BINDINGS--------------------------------------------------------------------
    - PyQt5 Version................. 5.15.9
    - PyQt5 Qt Version.............. 5.15.8
* QT ABSTRACTIONS----------------------------------------------------------------
    - qtpy Version.................. 2.4.2
    - qtpy Binding.................. pyqt5
    - qtpy Binding Variable......... os.environ['QT_API']
    - qtpy Import Name.............. qtpy
    - qtpy Status................... OK
* PYTHON PACKAGES----------------------------------------------------------------
    - helpdev....................... 0.7.1
    - QDarkStyle.................... 3.2.3

Language

Python

Description / Steps to Reproduce [if necessary]

  1. Create a horizontal slider with an invertedApparance set to True
  2. Create a vertical slider with an invertedAppearance set to True

Observe how their apperance isn't inverted

Actual Result

I feel like I got the horizontal slider, but not the vertical one.... very confusing...
image

Expected Results / Proposed Result

Notice how the inverted ones look inverted
image

Relevant Code [if necessary]

[A piece of code to reproduce and/or fix this issue]

diff --git a/qdarkstyle/qss/_styles.scss b/qdarkstyle/qss/_styles.scss
index 7c7874e..e2f4772 100644
--- a/qdarkstyle/qss/_styles.scss
+++ b/qdarkstyle/qss/_styles.scss
@@ -1449,6 +1449,17 @@ QSlider {
                 background: $COLOR_ACCENT_1;
             }
         }
+        &:vertical[invertedAppearance=true] {
+            background: $COLOR_BACKGROUND_4;
+        }
+        &:horizontal[invertedAppearance=true] {
+            background: $COLOR_ACCENT_2;
+            border: $BORDER_2;
+
+            &:disabled[invertedAppearance=true] {
+                background: $COLOR_ACCENT_1;
+            }
+        }
     }
 
     &::sub-page {
@@ -1464,6 +1475,27 @@ QSlider {
                 background: $COLOR_ACCENT_1;
             }
         }
+        &:horizontal[invertedAppearance=true] {
+            background: $COLOR_BACKGROUND_4;
+        }
+        // I can't tell where these colors are being used...
+        &vertical {
+            background: #0f0;
+            background-color: #0f0;
+            &:disabled {
+                background: #000;
+                background-color: #000;
+            }
+        }
+        &vertical[invertedAppearance=true] {
+            background: #f00;
+            background-color: #f00;
+
+            &:disabled[invertedAppearance=true] {
+                background: #00f;
+                background-color: #00f;
+            }
+        }
     }
 
     &::handle {
@hmaarrfk hmaarrfk linked a pull request Dec 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant