[gthumb] preferences dialog: added ability to change trasparency style



commit bbcd440855d7559e7d6660c4d4503743e903460b
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Nov 4 11:30:50 2019 +0100

    preferences dialog: added ability to change trasparency style

 .../data/ui/image-viewer-preferences.ui            | 94 ++++++++++++++++++++--
 extensions/image_viewer/preferences.c              | 17 ++++
 2 files changed, 103 insertions(+), 8 deletions(-)
---
diff --git a/extensions/image_viewer/data/ui/image-viewer-preferences.ui 
b/extensions/image_viewer/data/ui/image-viewer-preferences.ui
index dad9e638..66cd1ff5 100644
--- a/extensions/image_viewer/data/ui/image-viewer-preferences.ui
+++ b/extensions/image_viewer/data/ui/image-viewer-preferences.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface>
-  <requires lib="gtk+" version="3.0"/>
+  <requires lib="gtk+" version="3.16"/>
   <object class="GtkBox" id="preferences_page">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -17,9 +17,9 @@
           <object class="GtkLabel" id="label1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
             <property name="label" translatable="yes">After loading an image:</property>
             <property name="use_markup">True</property>
+            <property name="xalign">0</property>
             <attributes>
               <attribute name="weight" value="bold"/>
             </attributes>
@@ -74,11 +74,10 @@
                 <child>
                   <object class="GtkCheckButton" id="toggle_reset_scrollbars">
                     <property name="label" translatable="yes">Reset scrollbar positions</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
-                    <property name="xalign">0</property>
+                    <property name="halign">start</property>
                     <property name="draw_indicator">True</property>
                   </object>
                   <packing>
@@ -113,9 +112,9 @@
           <object class="GtkLabel" id="label2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
             <property name="label" translatable="yes">Zoom quality:</property>
             <property name="use_markup">True</property>
+            <property name="xalign">0</property>
             <attributes>
               <attribute name="weight" value="bold"/>
             </attributes>
@@ -136,14 +135,15 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="orientation">vertical</property>
+                <property name="spacing">6</property>
                 <child>
                   <object class="GtkRadioButton" id="zoom_quality_high_radiobutton">
                     <property name="label" translatable="yes" context="zoom quality">_High</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
+                    <property name="halign">start</property>
                     <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
                     <property name="active">True</property>
                     <property name="draw_indicator">True</property>
                   </object>
@@ -159,8 +159,8 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
+                    <property name="halign">start</property>
                     <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
                     <property name="active">True</property>
                     <property name="draw_indicator">True</property>
                     <property name="group">zoom_quality_high_radiobutton</property>
@@ -187,5 +187,83 @@
         <property name="position">1</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkBox" id="box5">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="label3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Transparency:</property>
+            <property name="use_markup">True</property>
+            <property name="xalign">0</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkAlignment" id="alignment3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkBox" id="box7">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkBox">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkComboBoxText" id="transparency_style_combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <items>
+                          <item translatable="yes">Checkered</item>
+                          <item translatable="yes">White</item>
+                          <item translatable="yes">Gray</item>
+                          <item translatable="yes">Black</item>
+                        </items>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">2</property>
+      </packing>
+    </child>
   </object>
 </interface>
diff --git a/extensions/image_viewer/preferences.c b/extensions/image_viewer/preferences.c
index 612dca88..b499c3c6 100644
--- a/extensions/image_viewer/preferences.c
+++ b/extensions/image_viewer/preferences.c
@@ -67,6 +67,16 @@ zoom_quality_radiobutton_toggled_cb (GtkToggleButton *button,
 }
 
 
+static void
+transparency_style_changed_cb (GtkComboBox *combo_box,
+                              BrowserData *data)
+{
+       g_settings_set_enum (data->settings,
+                            PREF_IMAGE_VIEWER_TRANSPARENCY_STYLE,
+                            gtk_combo_box_get_active (combo_box));
+}
+
+
 void
 image_viewer__dlg_preferences_construct_cb (GtkWidget  *dialog,
                                            GthBrowser *browser,
@@ -97,6 +107,9 @@ image_viewer__dlg_preferences_construct_cb (GtkWidget  *dialog,
        else
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET 
("zoom_quality_high_radiobutton")), TRUE);
 
+       gtk_combo_box_set_active (GTK_COMBO_BOX (GET_WIDGET ("transparency_style_combobox")),
+                                 g_settings_get_enum (data->settings, PREF_IMAGE_VIEWER_TRANSPARENCY_STYLE));
+
        g_signal_connect (GET_WIDGET ("change_zoom_combobox"),
                          "changed",
                          G_CALLBACK (zoom_change_changed_cb),
@@ -113,6 +126,10 @@ image_viewer__dlg_preferences_construct_cb (GtkWidget  *dialog,
                          "toggled",
                          G_CALLBACK (reset_scrollbars_toggled_cb),
                          data);
+       g_signal_connect (GET_WIDGET ("transparency_style_combobox"),
+                         "changed",
+                         G_CALLBACK (transparency_style_changed_cb),
+                         data);
 
        label = gtk_label_new (_("Viewer"));
        gtk_widget_show (label);


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