Commit 159c9afe authored by Julian Sparber's avatar Julian Sparber
Browse files

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.

GNOME/gnome-control-center#864
parent 4838ce42
......@@ -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
......
......@@ -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>
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment