[gnome-builder] workbench: extract fullscreen into toplevel button
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] workbench: extract fullscreen into toplevel button
- Date: Thu, 14 Dec 2017 08:55:54 +0000 (UTC)
commit 45e7e26aac1c3d3b65f7a50f42ef9ab2017a2391
Author: Christian Hergert <chergert redhat com>
Date: Thu Dec 14 00:48:43 2017 -0800
workbench: extract fullscreen into toplevel button
This gets us down to just the flatpak menu in the gear menu to remove.
src/libide/gtk/menus.ui | 6 ------
src/libide/workbench/ide-workbench-header-bar.c | 12 ++++++++++--
src/libide/workbench/ide-workbench-header-bar.ui | 5 +++--
3 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/src/libide/gtk/menus.ui b/src/libide/gtk/menus.ui
index ab110ad..6806cd2 100644
--- a/src/libide/gtk/menus.ui
+++ b/src/libide/gtk/menus.ui
@@ -65,12 +65,6 @@
</section>
</menu>
<menu id="gear-menu">
- <section id="gear-menu-fullscreen-section">
- <item>
- <attribute name="label" translatable="yes">_Fullscreen</attribute>
- <attribute name="action">win.fullscreen</attribute>
- </item>
- </section>
</menu>
<menu id="ide-source-view-popup-menu">
<section id="ide-source-view-popup-menu-jump-section">
diff --git a/src/libide/workbench/ide-workbench-header-bar.c b/src/libide/workbench/ide-workbench-header-bar.c
index a1a96fc..f3c9988 100644
--- a/src/libide/workbench/ide-workbench-header-bar.c
+++ b/src/libide/workbench/ide-workbench-header-bar.c
@@ -30,6 +30,7 @@
typedef struct
{
GtkToggleButton *fullscreen_button;
+ GtkImage *fullscreen_image;
GtkMenuButton *menu_button;
DzlPriorityBox *right_box;
DzlPriorityBox *left_box;
@@ -86,6 +87,7 @@ ide_workbench_header_bar_class_init (IdeWorkbenchHeaderBarClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/ide-workbench-header-bar.ui");
gtk_widget_class_bind_template_child_private (widget_class, IdeWorkbenchHeaderBar, fullscreen_button);
+ gtk_widget_class_bind_template_child_private (widget_class, IdeWorkbenchHeaderBar, fullscreen_image);
gtk_widget_class_bind_template_child_private (widget_class, IdeWorkbenchHeaderBar, left_box);
gtk_widget_class_bind_template_child_private (widget_class, IdeWorkbenchHeaderBar, menu_button);
gtk_widget_class_bind_template_child_private (widget_class, IdeWorkbenchHeaderBar, omni_bar);
@@ -253,9 +255,15 @@ _ide_workbench_header_bar_set_fullscreen (IdeWorkbenchHeaderBar *self,
gboolean fullscreen)
{
IdeWorkbenchHeaderBarPrivate *priv = ide_workbench_header_bar_get_instance_private (self);
+ const gchar *icon_names[] = {
+ "view-fullscreen-symbolic",
+ "view-restore-symbolic",
+ };
g_return_if_fail (IDE_IS_WORKBENCH_HEADER_BAR (self));
- gtk_widget_set_visible (GTK_WIDGET (priv->fullscreen_button), fullscreen);
- gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self), !fullscreen);
+ g_object_set (priv->fullscreen_button,
+ "icon-name", icon_names[!!fullscreen],
+ NULL);
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self), fullscreen == FALSE);
}
diff --git a/src/libide/workbench/ide-workbench-header-bar.ui
b/src/libide/workbench/ide-workbench-header-bar.ui
index f6fd658..2fe83d9 100644
--- a/src/libide/workbench/ide-workbench-header-bar.ui
+++ b/src/libide/workbench/ide-workbench-header-bar.ui
@@ -71,12 +71,13 @@
<object class="GtkToggleButton" id="fullscreen_button">
<property name="action-name">win.fullscreen</property>
<property name="focus-on-click">false</property>
+ <property name="visible">true</property>
<style>
<class name="image-button"/>
</style>
<child>
- <object class="GtkImage">
- <property name="icon-name">view-restore-symbolic</property>
+ <object class="GtkImage" id="fullscreen_image">
+ <property name="icon-name">view-fullscreen-symbolic</property>
<property name="visible">true</property>
</object>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]