francescmm / GitQlient

GitQlient: Multi-platform Git client written with Qt.
https://www.francescmm.com
GNU Lesser General Public License v2.1
843 stars 84 forks source link

[BUG] Style colours not being populated on several places #262

Closed band-a-prend closed 1 year ago

band-a-prend commented 1 year ago

Describe the bug Credentials configuration wizard, Plugin and Shortcuts config tabs, Set log level or Styles schema drop down menus don't use setup Style schema's colours.

To Reproduce

Before remove/backup configuration files in ~/.config/ and /repo_path/.git/GitQlientConfig.ini if needed.

Steps to reproduce the behavior:

  1. Clone the repository into new location: git clone https://github.com/francescmm/GitQlient.git.
  2. Launch the GitQlient and at start window chose "Open" and select cloned repo.
  3. Notice the theme colours and sizes of appeared Credentials configuration wizard window and the size of above description section (subsection uses bright style theme): Repo_config_decoration
  4. Change settings if required and click Save button.
  5. In opened application windows with commits list go to Config (i.e. Gear icon) to Plugin and Shortcuts tabs.
  6. Noticed the colours of tab's subsections (subsection uses bright style theme): Plugins_tab Shortcuts_tab
  7. Go to GitQlient config tab, change theme to bright and restart application.
  8. Go to Config (i.e. Gear icon) -> GitQlient tab and expand Set log level or Styles schema drop down menus.
  9. Noticed that the expanded list uses dark theme: Config_GitQlient_bright_theme_loglevel Config_GitQlient_bright_theme_styles_schema

Expected behavior The colours of interface elements corresponds the selected style settings. The size of Credentials configuration wizard window is sufficient to display all placed text information.

Screenshots See above.

Desktop (please complete the following information):

Additional context The issue is similar to https://github.com/francescmm/GitQlient/issues/208

band-a-prend commented 1 year ago

P.S.
About GitQlient Copyright YEAR could be updated: About_GitQlient

francescmm commented 1 year ago

Thanks for the report @band-a-prend!

francescmm commented 1 year ago

One question about the compilation, are you using CMake or QMake for it? I wonder if that could be the issue (although improvable).

When I download the AppImage I cannot see it happening :confused:

band-a-prend commented 1 year ago

I used qmake to compile with gcc 11.3.0 and Qt 5.15.7.

Did I remove all created by GitQlient configuration files that mentioned at the start of issue description? It seems early I found another one and remove it too but it isn't created with new versions.

I have to try recheck after enabling warning or debug log level and swith logs on.

band-a-prend commented 1 year ago

@tim77 Could you please check if this issue is reproduced or not in Fedora?

band-a-prend commented 1 year ago

The appimage isn't affected by issue for me too. I forgot to mention that after built with qmake I installed running qmake install (within sandbox before merge into system). So application uses only that files that actually installed into system (except created configs).

I want to check the ist of built files, installed files and list files from appimage.

tim77 commented 1 year ago

On vanilla Fedora 37 (GNOME; Wayland session) LGTM, no issue: image GitQlient v1.6.1 from Fedora repos.

band-a-prend commented 1 year ago

@tim77 great thanks for checking.

@francescmm I noticed that for me appimage uses own open dialog window for selection of directory with dark style similar with gitqlient, while system installed application uses system colours and style (my case: kde-plasma light breeze).

francescmm commented 1 year ago

@band-a-prend yeah, KDE has custom style features that I don't support for now. It's a feature that tightens the code close to the environment so it adds comlexity to GitQlient, it being multiplatform.

band-a-prend commented 1 year ago

Could it be supressed to make GitQlient always to use built-in styles instead of KDE's even if available if issue is related to this?

francescmm commented 1 year ago

I guess so, but I'm gonna need to know how to do it! I actually thought that something special was needed to use KDE styles, not that they were used by default... 😕 😅

band-a-prend commented 1 year ago

@francescmm I fixed some of issues for dark StylesSchema with the following patch:

--- a/src/aux_widgets/InitialRepoConfig.ui
+++ b/src/aux_widgets/InitialRepoConfig.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>600</width>
-    <height>400</height>
+    <height>500</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -184,6 +184,12 @@
      <property name="title">
       <string>Credentials configuration</string>
      </property>
+     <property name="autoFillBackground">
+      <bool>false</bool>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">background: transparent;</string>
+     </property>
      <layout class="QGridLayout" name="gridLayout_2">
       <property name="leftMargin">
        <number>0</number>
diff -Naur a/src/big_widgets/ConfigWidget.ui b/src/big_widgets/ConfigWidget.ui
--- a/src/big_widgets/ConfigWidget.ui
+++ b/src/big_widgets/ConfigWidget.ui
@@ -678,7 +678,7 @@
                   <number>10</number>
                  </property>
                  <item row="0" column="0" colspan="2">
-                  <widget class="QCheckBox" name="chbCredentials">
+                  <widget class="CheckBox" name="chbCredentials">
                    <property name="text">
                     <string>Store credentials using GitQlient (Current session or in Storage)</string>
                    </property>
@@ -1018,6 +1018,12 @@
          <property name="title">
           <string>Installed plugins</string>
          </property>
+         <property name="autoFillBackground">
+          <bool>false</bool>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">background: transparent;</string>
+         </property>
          <layout class="QGridLayout" name="pluginsLayout">
           <property name="leftMargin">
            <number>10</number>
@@ -1129,6 +1135,12 @@
          <property name="title">
           <string>Official GitQlient plugins</string>
          </property>
+         <property name="autoFillBackground">
+          <bool>false</bool>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">background: transparent;</string>
+         </property>
          <layout class="QGridLayout" name="availablePluginsLayout">
           <property name="leftMargin">
            <number>10</number>
@@ -1213,6 +1225,12 @@
          <property name="title">
           <string>Branches panel</string>
          </property>
+         <property name="autoFillBackground">
+          <bool>false</bool>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">background: transparent;</string>
+         </property>
          <layout class="QGridLayout" name="gridLayout_8">
           <item row="0" column="1">
            <widget class="QLabel" name="label_62">
@@ -1250,6 +1268,12 @@
          <property name="title">
           <string>GitQlient repo operations</string>
          </property>
+         <property name="autoFillBackground">
+          <bool>false</bool>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">background: transparent;</string>
+         </property>
          <layout class="QGridLayout" name="gridLayout_9">
           <item row="3" column="1">
            <widget class="QLabel" name="label_45">
@@ -1315,6 +1339,12 @@
          <property name="title">
           <string>GitQlient general</string>
          </property>
+         <property name="autoFillBackground">
+          <bool>false</bool>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">background: transparent;</string>
+         </property>
          <layout class="QGridLayout" name="gridLayout_10">
           <item row="3" column="1">
            <widget class="QLabel" name="label_54">

I.e. I just use the style properties of QWidget from "GitClient" settings tab and apply it for "Plugins" and "Shortcuts" tans.

But the issue with QComboBox background colour of "GitQlient" settings tab for "bright" StylesSchema is unresolved. I don't know how to set QComboBox background colour like on "Repository" tab without breaking of QWidget background colour.

On the https://doc.qt.io/qt-5/qwidget.html#autoFillBackground-prop there is a warning:

Warning: Use this property with caution in conjunction with [Qt Style Sheets](https://doc.qt.io/qt-5/stylesheet.html). 
When a widget has a style sheet with a valid background or a border-image, this property is automatically disabled.
band-a-prend commented 1 year ago

@francescmm I found another solutions to fix issue and will prepare patch for pull request.

Briefly: