[gnome-control-center] background: Remove the popover



commit 159c9afe93f73bb2cfed89533cca4cf1394dc715
Author: Julian Sparber <julian sparber net>
Date:   Fri Feb 14 16:10:43 2020 +0100

    background: Remove the popover
    
    In 3.36, we will use a heavily blurred wallpaper on the lock screen.
    
    As that wallpaper will be unrecognizable, there is no good reason to
    pick a different one from the regular session. The shell will therefore
    stop using the separate lock-screen settings.
    The popover isn't needed anymore because it would only have one option:
    to set the wallpaper. And an additional option for the recent section to
    remove the wallpaper for the list, which can be done via a overlay
    button.
    
    https://gitlab.gnome.org/GNOME/gnome-control-center/issues/864

 panels/background/cc-background-chooser.c  | 36 +----------------
 panels/background/cc-background-chooser.ui | 62 ------------------------------
 panels/background/cc-background-panel.c    |  8 +---
 3 files changed, 3 insertions(+), 103 deletions(-)
---
diff --git a/panels/background/cc-background-chooser.c b/panels/background/cc-background-chooser.c
index 4f3fd0dff..b4db160cf 100644
--- a/panels/background/cc-background-chooser.c
+++ b/panels/background/cc-background-chooser.c
@@ -35,10 +35,8 @@ struct _CcBackgroundChooser
   GtkBox              parent;
 
   GtkFlowBox         *flowbox;
-  GtkWidget          *popover_recent_box;
   GtkWidget          *recent_box;
   GtkFlowBox         *recent_flowbox;
-  GtkPopover         *selection_popover;
 
   gboolean            recent_selected;
 
@@ -180,40 +178,13 @@ on_delete_background_clicked_cb (GtkButton           *button,
   bg_recent_source_remove_item (self->recent_source, item);
 }
 
-static void
-on_selection_desktop_lock_clicked_cb (GtkButton           *button,
-                                      CcBackgroundChooser *self)
-{
-  emit_background_chosen (self, CC_BACKGROUND_SELECTION_DESKTOP | CC_BACKGROUND_SELECTION_LOCK_SCREEN);
-  gtk_popover_popdown (self->selection_popover);
-}
-
-static void
-on_selection_desktop_clicked_cb (GtkButton           *button,
-                                 CcBackgroundChooser *self)
-{
-  emit_background_chosen (self, CC_BACKGROUND_SELECTION_DESKTOP);
-  gtk_popover_popdown (self->selection_popover);
-}
-
-static void
-on_selection_lock_clicked_cb (GtkButton           *button,
-                              CcBackgroundChooser *self)
-{
-  emit_background_chosen (self, CC_BACKGROUND_SELECTION_LOCK_SCREEN);
-  gtk_popover_popdown (self->selection_popover);
-}
-
 static void
 on_item_activated_cb (GtkFlowBox          *flowbox,
                       GtkFlowBoxChild     *child,
                       CcBackgroundChooser *self)
 {
   self->recent_selected = flowbox == self->recent_flowbox;
-  gtk_widget_set_visible (self->popover_recent_box, self->recent_selected);
-
-  gtk_popover_set_relative_to (self->selection_popover, GTK_WIDGET (child));
-  gtk_popover_popup (self->selection_popover);
+  emit_background_chosen (self, CC_BACKGROUND_SELECTION_DESKTOP);
 }
 
 static void
@@ -313,16 +284,11 @@ cc_background_chooser_class_init (CcBackgroundChooserClass *klass)
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/control-center/background/cc-background-chooser.ui");
 
   gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, flowbox);
-  gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, popover_recent_box);
   gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, recent_box);
   gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, recent_flowbox);
-  gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, selection_popover);
 
   gtk_widget_class_bind_template_callback (widget_class, on_delete_background_clicked_cb);
   gtk_widget_class_bind_template_callback (widget_class, on_item_activated_cb);
-  gtk_widget_class_bind_template_callback (widget_class, on_selection_desktop_lock_clicked_cb);
-  gtk_widget_class_bind_template_callback (widget_class, on_selection_desktop_clicked_cb);
-  gtk_widget_class_bind_template_callback (widget_class, on_selection_lock_clicked_cb);
 }
 
 static void
diff --git a/panels/background/cc-background-chooser.ui b/panels/background/cc-background-chooser.ui
index c5612fac0..aa7da281a 100644
--- a/panels/background/cc-background-chooser.ui
+++ b/panels/background/cc-background-chooser.ui
@@ -87,66 +87,4 @@
     </child>
 
   </template>
-
-  <!-- Desktop & Lock Screen Popover -->
-  <object class="GtkPopover" id="selection_popover">
-    <property name="position">bottom</property>
-    <child>
-      <object class="GtkBox">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">6</property>
-        <property name="margin">12</property>
-        <child>
-          <object class="GtkButton">
-            <property name="visible">True</property>
-            <property name="label" translatable="yes">Set Background and Lock Screen</property>
-            <signal name="clicked" handler="on_selection_desktop_lock_clicked_cb" 
object="CcBackgroundChooser" swapped="no" />
-            <style>
-              <class name="suggested-action" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkButton">
-            <property name="visible">True</property>
-            <property name="label" translatable="yes">Set Background</property>
-            <signal name="clicked" handler="on_selection_desktop_clicked_cb" object="CcBackgroundChooser" 
swapped="no" />
-          </object>
-        </child>
-        <child>
-          <object class="GtkButton">
-            <property name="visible">True</property>
-            <property name="label" translatable="yes">Set Lock Screen</property>
-            <signal name="clicked" handler="on_selection_lock_clicked_cb" object="CcBackgroundChooser" 
swapped="no" />
-          </object>
-        </child>
-
-        <!-- Recent items section -->
-        <child>
-          <object class="GtkBox" id="popover_recent_box">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">6</property>
-            <child>
-              <object class="GtkSeparator">
-                <property name="visible">True</property>
-                <property name="margin-top">12</property>
-                <property name="margin-bottom">12</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkButton">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">Remove Background</property>
-                <signal name="clicked" handler="on_delete_background_clicked_cb" 
object="CcBackgroundChooser" swapped="no" />
-              </object>
-            </child>
-          </object>
-        </child>
-      </object>
-    </child>
-  </object>
 </interface>
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 27efe88b0..fc9bc0067 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -232,12 +232,8 @@ on_chooser_background_chosen_cb (CcBackgroundChooser        *chooser,
                                  CcBackgroundSelectionFlags  flags,
                                  CcBackgroundPanel          *self)
 {
-
-  if (flags & CC_BACKGROUND_SELECTION_DESKTOP)
-    set_background (self, self->settings, item);
-
-  if (flags & CC_BACKGROUND_SELECTION_LOCK_SCREEN)
-    set_background (self, self->lock_settings, item);
+  set_background (self, self->settings, item);
+  set_background (self, self->lock_settings, item);
 }
 
 static void


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