[gnome-themes-standard: 2/7] Update and fix comments and aligning.



commit 06dd02a034eddbd59fc1005d7ece0a37c4c44446
Author: Juraj Fiala <doctorjellyface riseup net>
Date:   Wed Sep 28 17:15:16 2016 +0200

    Update and fix comments and aligning.

 themes/Adwaita/gtk-2.0/apps.rc    |   32 +---------
 themes/Adwaita/gtk-2.0/gtkrc      |   27 ++++++--
 themes/Adwaita/gtk-2.0/gtkrc-dark |   27 ++++++--
 themes/Adwaita/gtk-2.0/hacks.rc   |   36 +++++++++++
 themes/Adwaita/gtk-2.0/main.rc    |  120 +++++++++++++++++++++----------------
 5 files changed, 148 insertions(+), 94 deletions(-)
---
diff --git a/themes/Adwaita/gtk-2.0/apps.rc b/themes/Adwaita/gtk-2.0/apps.rc
index 6138d55..916acfd 100644
--- a/themes/Adwaita/gtk-2.0/apps.rc
+++ b/themes/Adwaita/gtk-2.0/apps.rc
@@ -1,8 +1,8 @@
 # vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et:
-
-style "toplevel_hack" {
-  engine "adwaita" {}
-}
+#
+# This file, unlike hacks.rc, contains legitimate cases we need to handle, e.g.
+# custom widgets, programs giving us a chance to alter their UI to fit more with
+# the theme or stuff that is supposed to look different, like panels.
 
 # TODO: This could really look nicer
 style "gimp_spin_scale" {
@@ -92,32 +92,8 @@ style "chrome_gtk_frame" {
 
 }
 
-style "chrome_entry" {
-  base[NORMAL]      = @base_color
-  base[INSENSITIVE] = @base_color
-}
-
-style "vim_notebook" {
-  bg[NORMAL] = @base_color
-  bg[ACTIVE] = @insensitive_bg_color
-}
-
-# Vim puts an eventbox between the tab and the label and colours it,
-# we need to handle that
-widget "vim-main-window*GtkNotebook.GtkEventBox" style "vim_notebook"
-
-# (he)xchat input box
-class "SexySpellEntry" style:highest "normal_entry"
-
 # Disable spin button assets for GimpSpinScale
 class "GimpSpinScale" style "gimp_spin_scale"
 
 # Chromium lets us define some colours and settings for better integration
 class "ChromeGtkFrame" style "chrome_gtk_frame"
-# Chromium uses base as the fill colour of its own entries
-# This would be fine but Gtk+ uses it to fill the surrounding space, so its set to bg
-# That results in Chromium using it for the fill, so we need to handle that
-widget_class "*Chrom*<GtkEntry>" style "chrome_entry"
-
-# Hack to be able to match widgets in LibreOffice
-class "GtkWindow" style "toplevel_hack"
diff --git a/themes/Adwaita/gtk-2.0/gtkrc b/themes/Adwaita/gtk-2.0/gtkrc
index 2434407..453bcc1 100755
--- a/themes/Adwaita/gtk-2.0/gtkrc
+++ b/themes/Adwaita/gtk-2.0/gtkrc
@@ -1,23 +1,36 @@
 # Based on Bridge by ScionicSpectre
 # vim:set ts=2 sw=2 sts=2 ai et:
+#
+# This is the GTK+ 2 version of Adwaita. It's whole purpose is to look as the
+# GTK+ 3 version as much as possible until GTK+ 2 dies copmletely.
+#
+# Note: comments for explaining styles are on the bottom of each file beside the
+# widget matches.
 
-# Text/base colors
+# Declare the colours used throughout the theme.
+# There shouldn't be any fiddling with them in the theme files themselves in
+# order to not mess up the dark theme.
+
+# Text/base
 gtk-color-scheme = "text_color:black\nbase_color:white"
-# Foreground/background colors
+# Foreground/background
 gtk-color-scheme = "fg_color:#2e3436\nbg_color:#e8e8e7"
-# Selected foreground/background colors
+# Selected foreground/background
 gtk-color-scheme = "selected_fg_color:#ffffff\nselected_bg_color:#4a90d9"
-# Insensitive foreground/background colors
+# Insensitive foreground/background
 gtk-color-scheme = "insensitive_fg_color:#8b8e8f\ninsensitive_bg_color:#f1f1f1"
-# Link colors
+# Links
 gtk-color-scheme = "link_color:#2a76c6\nvisited_link_color:#215d9c"
-# Window colors
+# Window decoration
 gtk-color-scheme = "window_color:#f4f4f4"
-# Tooltip colors
+# Tooltips
 gtk-color-scheme = "tooltip_fg_color:#ffffff\ntooltip_bg_color:#343434"
 
+# Set GTK settings
 gtk-auto-mnemonics              = 1
 gtk-primary-button-warps-slider = 1
 
+# And hand over the control to the theme files
 include "main.rc"
 include "apps.rc"
+include "hacks.rc"
diff --git a/themes/Adwaita/gtk-2.0/gtkrc-dark b/themes/Adwaita/gtk-2.0/gtkrc-dark
index bd032d4..0e45533 100755
--- a/themes/Adwaita/gtk-2.0/gtkrc-dark
+++ b/themes/Adwaita/gtk-2.0/gtkrc-dark
@@ -1,23 +1,36 @@
 # Based on Bridge by ScionicSpectre
 # vim:set ts=2 sw=2 sts=2 ai et:
+#
+# This is the GTK+ 2 version of Adwaita. It's whole purpose is to look as the
+# GTK+ 3 version as much as possible until GTK+ 2 dies copmletely.
+#
+# Note: comments for explaining styles are on the bottom of each file beside the
+# widget matches.
 
-# Text/base colors
+# Declare the colours used throughout the theme.
+# There shouldn't be any fiddling with them in the theme files themselves in
+# order to not mess up the dark theme.
+
+# Text/base
 gtk-color-scheme = "text_color:white\nbase_color:#292929"
-# Foreground/background colors
+# Foreground/background
 gtk-color-scheme = "fg_color:#eeeeec\nbg_color:#393f3f"
-# Selected foreground/background colors
+# Selected foreground/background
 gtk-color-scheme = "selected_fg_color:#ffffff\nselected_bg_color:#215d9c"
-# Insensitive foreground/background colors
+# Insensitive foreground/background
 gtk-color-scheme = "insensitive_fg_color:#949796\ninsensitive_bg_color:#333636"
-# Link colors
+# Links
 gtk-color-scheme = "link_color:#4a90d9\nvisited_link_color:#2a76c6"
-# Window colors
+# Window decoration
 gtk-color-scheme = "window_color:#2c3133"
-# Tooltip colors
+# Tooltips
 gtk-color-scheme = "tooltip_fg_color:#ffffff\ntooltip_bg_color:#343434"
 
+# Set GTK settings
 gtk-auto-mnemonics              = 1
 gtk-primary-button-warps-slider = 1
 
+# And hand over the control to the theme files
 include "main.rc"
 include "apps.rc"
+include "hacks.rc"
diff --git a/themes/Adwaita/gtk-2.0/hacks.rc b/themes/Adwaita/gtk-2.0/hacks.rc
new file mode 100644
index 0000000..1bdbee9
--- /dev/null
+++ b/themes/Adwaita/gtk-2.0/hacks.rc
@@ -0,0 +1,36 @@
+# vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et:
+#
+# This file contains horrible hacks to make this theme work with some programs
+# This is mostly due to the limitations of gtk2 but sometimes its the fault of
+# the programs themselves. Not going to point fingers.
+#
+# Either way, it's a WONTFIX for both, hence this horrible file.
+
+style "toplevel_hack" {
+  engine "adwaita" {}
+}
+
+style "chrome_entry" {
+  base[NORMAL]      = @base_color
+  base[INSENSITIVE] = @base_color
+}
+
+style "vim_notebook" {
+  bg[NORMAL] = @base_color
+  bg[ACTIVE] = @insensitive_bg_color
+}
+
+# Vim puts an eventbox between the tab and the label and colours it,
+# we need to handle that
+widget "vim-main-window*GtkNotebook.GtkEventBox" style "vim_notebook"
+
+# (he)xchat input box
+class "SexySpellEntry" style:highest "normal_entry"
+
+# Chromium uses base as the fill colour of its own entries
+# This would be fine but Gtk+ uses it to fill the surrounding space, so its set to bg
+# That results in Chromium using it for the fill, so we need to handle that
+widget_class "*Chrom*<GtkEntry>" style "chrome_entry"
+
+# Hack to be able to match widgets in LibreOffice
+class "GtkWindow" style "toplevel_hack"
diff --git a/themes/Adwaita/gtk-2.0/main.rc b/themes/Adwaita/gtk-2.0/main.rc
index 5610378..9b8ed5e 100644
--- a/themes/Adwaita/gtk-2.0/main.rc
+++ b/themes/Adwaita/gtk-2.0/main.rc
@@ -1,4 +1,9 @@
 # vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et:
+#
+# This is the main theme file, handling all the default widgets and theme
+# properties. Since GTK+ 2 is old, we need to overcome some of its limitations,
+# which is also mostly done in this file. Sadly not all of them can be overcome
+# so there will always be a visible difference between the GTK+ 2 and 3 theme.
 
 style "default" {
 
@@ -1045,9 +1050,8 @@ style "default" {
     # Scales #
     ##########
 
-    # Troughs
-    # They are overrided later on
-    # We set them here too because some widgets don't specify their orientation
+    # Troughs, overrided later on. We set them here too because some widgets
+    # don't specify their orientation.
 
     image {
       function    = BOX
@@ -2028,9 +2032,10 @@ style "combobox_entry" {
 
 style "combo_button_padding" {
 
-  # Since one side of the button is missing, we need to shift the arrow a little to the right
+  # Since one side of the button is missing, we need to shift the arrow a
+  # little to the right.
   # This is the same thing we've done above but the combo, unlike the combobox,
-  # uses padding the same way as a button
+  # uses padding the same way as a button.
   GtkButton::inner-border = {6, 8, 4, 4}
 
 }
@@ -2470,71 +2475,81 @@ style "disable_separator" {
 
 }
 
-# Default style, containing most of the stuff
-class "GtkWidget"            style "default"
-
-# Override padding,          style and colour
-class "GtkButton"            style "button"
-class "GtkLinkButton"        style "link_button"
-class "GtkEntry"             style "entry"
-class "GtkOldEditable"       style "entry"
-class "GtkNotebook"          style "notebook"
-class "GtkHScale"            style "scale_horz"
-class "GtkVScale"            style "scale_vert"
-class "GtkProgressBar"       style "progressbar"
-class "GtkScrolledWindow"    style "scrolled_window"
-class "GtkFrame"             style "frame"
-class "GtkSeparatorToolItem" style "toolbar_separator"
-class "GtkMenuBar"           style "menubar"
-class "GtkMenu"              style "menu"
-class "GtkTextView"          style "textview"
+# Default style, containing theme properties and trying to match every widget as
+# much as possible, which is not only faster than trying to match every widget
+# by its own but also less bug-prune and more consistent. However there is some
+# widget specific stuff that needs to be taken care of, which is the point of
+# every other style below.
+class "GtkWidget" style "default"
+
+ ######################################
+ # Override padding, style and colour #
+ ######################################
+
+class "GtkButton"                                                  style "button"
+class "GtkLinkButton"                                              style "link_button"
+class "GtkEntry"                                                   style "entry"
+class "GtkOldEditable"                                             style "entry"
+class "GtkNotebook"                                                style "notebook"
+class "GtkHScale"                                                  style "scale_horz"
+class "GtkVScale"                                                  style "scale_vert"
+class "GtkProgressBar"                                             style "progressbar"
+class "GtkScrolledWindow"                                          style "scrolled_window"
+class "GtkFrame"                                                   style "frame"
+class "GtkSeparatorToolItem"                                       style "toolbar_separator"
+class "GtkMenuBar"                                                 style "menubar"
+class "GtkMenu"                                                    style "menu"
+class "GtkTextView"                                                style "textview"
 
 # Menu and menubar items
-widget_class "*<GtkMenuItem>*"              style "menu_item"
-widget_class "*<GtkMenuBar>.<GtkMenuItem>*" style "menubar_item"
-widget_class "*<GtkSeparatorMenuItem>*"     style "separator_menu_item"
+widget_class "*<GtkMenuItem>*"                                     style "menu_item"
+widget_class "*<GtkMenuBar>.<GtkMenuItem>*"                        style "menubar_item"
+widget_class "*<GtkSeparatorMenuItem>*"                            style "separator_menu_item"
 
 # Frames in statusbars look ugly, let's disable them
-widget_class "*<GtkStatusbar>*<GtkFrame>" style "disable_shadow"
+widget_class "*<GtkStatusbar>*<GtkFrame>"                          style "disable_shadow"
 # Disable the frame around poor Wilbert too
-widget_class "*<GimpToolbox>*<GtkFrame>"  style "disable_shadow"
+widget_class "*<GimpToolbox>*<GtkFrame>"                           style "disable_shadow"
 
 # Treeview buttons
-widget_class "*<GtkTreeView>*<GtkButton>*" style "treeview_header"
+widget_class "*<GtkTreeView>*<GtkButton>*"                         style "treeview_header"
 
 # Give the file chooser toolbar a border
-widget_class "*<GtkFileChooserDefault>*<GtkToolbar>" style "inline_toolbar"
+widget_class "*<GtkFileChooserDefault>*<GtkToolbar>"               style "inline_toolbar"
 
 # Fix padding on regular comboboxes
-widget_class "*<GtkComboBox>.<GtkButton>" style "combobox"
+widget_class "*<GtkComboBox>.<GtkButton>"                          style "combobox"
 # And disable separators on them
-widget_class "*<GtkComboBox>.<GtkButton>*<GtkSeparator>" style "disable_separator"
+widget_class "*<GtkComboBox>.<GtkButton>*<GtkSeparator>"           style "disable_separator"
 
 # Join together the ComboBoxEntry entry and button
-widget_class "*<GtkComboBoxEntry>*"  style "combobox_entry"
+widget_class "*<GtkComboBoxEntry>*"                                style "combobox_entry"
 
 # Join the Combo entry and button
-widget_class "*<GtkCombo>*"  style "combobox_entry"
-# Tweak the padding on the button a little bit because it uses it a bit differently
-widget_class "*<GtkCombo>.<GtkButton>" style "combo_button_padding"
+widget_class "*<GtkCombo>*"                                        style "combobox_entry"
+# Tweak the padding on the button a little bit because it
+# uses it a bit differently
+widget_class "*<GtkCombo>.<GtkButton>"                             style "combo_button_padding"
 
-# Alas we cannot do the same for ComboBoxText because there isn't a way to apply the style to only
-# the comboboxes that have an entry inside
+# Alas we cannot do the same for ComboBoxText because there
+# isn't a way to apply the style to only the comboboxes that
+# have an entry inside
 
 # Toolbar buttons have different paddings
-widget_class "*<GtkToolbar>*<GtkButton>" style "toolbar_button"
+widget_class "*<GtkToolbar>*<GtkButton>"                           style "toolbar_button"
 
 # Notebooks are white, act accordingly
-widget_class "*<GtkNotebook>*<GtkEntry>"                        style "notebook_entry"
-widget_class "*<GtkNotebook>*<GtkProgressBar>"                  style "notebook_bg"
-widget_class "*<GtkNotebook>*<GtkSpinButton>"                   style "notebook_bg"
-widget_class "*<GtkNotebook>*<GtkScrolledWindow>*<GtkViewport>" style "notebook_bg"
-widget_class "*<GtkNotebook>*<GimpRuler>"                       style "notebook_bg"
-widget_class "*<GtkNotebook>.<GimpDisplayShell>*<GtkEventBox>"  style "notebook_bg"
-widget_class "*<GtkNotebook>*<GtkComboBoxEntry>*"               style "notebook_combo"
-widget_class "*<GtkNotebook>*<GtkCombo>*"                       style "notebook_combo"
-
-# However, stuff inside eventboxes inside notebooks is grey again, react
+widget_class "*<GtkNotebook>*<GtkEntry>"                           style "notebook_entry"
+widget_class "*<GtkNotebook>*<GtkProgressBar>"                     style "notebook_bg"
+widget_class "*<GtkNotebook>*<GtkSpinButton>"                      style "notebook_bg"
+widget_class "*<GtkNotebook>*<GtkScrolledWindow>*<GtkViewport>"    style "notebook_bg"
+widget_class "*<GtkNotebook>*<GimpRuler>"                          style "notebook_bg"
+widget_class "*<GtkNotebook>.<GimpDisplayShell>*<GtkEventBox>"     style "notebook_bg"
+widget_class "*<GtkNotebook>*<GtkComboBoxEntry>*"                  style "notebook_combo"
+widget_class "*<GtkNotebook>*<GtkCombo>*"                          style "notebook_combo"
+
+# However, stuff inside eventboxes inside notebooks is grey
+# again, react
 widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkEntry>"             style "normal_entry"
 widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkProgressBar>"       style "normal_bg"
 widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkSpinButton>"        style "normal_bg"
@@ -2542,8 +2557,9 @@ widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkComboBoxEntry>*"    style "combob
 widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkCombo>*"            style "combobox_entry"
 widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkCombo>.<GtkButton>" style "combo_button_padding"
 
-# ComboBoxes tend to draw the button label with text[] instead of fg[], we need to fix that
-widget_class "*<GtkComboBox>*<GtkCellView>" style "combobox_cellview"
+# ComboBoxes tend to draw the button label with text[]
+# instead of fg[], we need to fix that
+widget_class "*<GtkComboBox>*<GtkCellView>"                        style "combobox_cellview"
 
 # GTK tooltips
-widget "gtk-tooltip*" style "tooltip"
+widget "gtk-tooltip*"                                              style "tooltip"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]