[glade/modern-ui: 20/34] GladeWindow: add GladeAdaptorChooser
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/modern-ui: 20/34] GladeWindow: add GladeAdaptorChooser
- Date: Sat, 30 Dec 2017 16:45:00 +0000 (UTC)
commit 57822f5c2778c2c2a1be4ee73c6fd4a5b3128069
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Sun Jun 25 17:17:07 2017 -0300
GladeWindow: add GladeAdaptorChooser
src/glade-window.c | 6 +++++-
src/glade.glade | 50 +++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 48 insertions(+), 8 deletions(-)
---
diff --git a/src/glade-window.c b/src/glade-window.c
index fc2e488..f10d8e6 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -34,6 +34,7 @@
#include <gladeui/glade.h>
#include <gladeui/glade-popup.h>
#include <gladeui/glade-inspector.h>
+#include <gladeui/glade-adaptor-chooser.h>
#include <gladeui/glade-project.h>
@@ -86,6 +87,7 @@ struct _GladeWindowPrivate
GtkLabel *subtitle;
GtkWidget *project_button;
+ GladeAdaptorChooser *adaptor_chooser;
GtkStack *inspectors_stack; /* Cached per project inspectors */
GladeEditor *editor; /* The editor */
@@ -1577,6 +1579,8 @@ on_stack_visible_child_notify (GObject *gobject,
gtk_stack_set_visible_child (priv->inspectors_stack,
g_object_get_data (G_OBJECT (view), "glade-window-view-inspector"));
+ glade_adaptor_chooser_set_project (priv->adaptor_chooser, project);
+
set_sensitivity_according_to_project (window, project);
refresh_undo_redo (window, project);
@@ -2344,7 +2348,6 @@ on_quit_action_activate (GtkAction *action, GladeWindow *window)
gtk_main_quit ();
}
-
static void
glade_window_init (GladeWindow *window)
{
@@ -2514,6 +2517,7 @@ glade_window_class_init (GladeWindowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/glade/glade.glade");
/* Internal children */
+ gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, adaptor_chooser);
gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, headerbar);
gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, title);
gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, subtitle);
diff --git a/src/glade.glade b/src/glade.glade
index 78b5cda..40fb9fd 100644
--- a/src/glade.glade
+++ b/src/glade.glade
@@ -246,7 +246,7 @@ Andreas Nilsson <andreas andreasn se></property>
<object class="GtkAction" id="previous_project_action">
<property name="label" translatable="yes">_Previous Project</property>
<property name="tooltip" translatable="yes">Activate previous project</property>
- <signal name="activate" handler="on_previous_project_action_activate"/>
+ <signal name="activate" handler="on_previous_project_action_activate" swapped="no"/>
</object>
<accelerator key="Page_Up" modifiers="GDK_CONTROL_MASK"/>
</child>
@@ -254,7 +254,7 @@ Andreas Nilsson <andreas andreasn se></property>
<object class="GtkAction" id="next_project_action">
<property name="label" translatable="yes">_Next Project</property>
<property name="tooltip" translatable="yes">Activate next project</property>
- <signal name="activate" handler="on_next_project_action_activate"/>
+ <signal name="activate" handler="on_next_project_action_activate" swapped="no"/>
</object>
<accelerator key="Page_Down" modifiers="GDK_CONTROL_MASK"/>
</child>
@@ -532,14 +532,50 @@ Andreas Nilsson <andreas andreasn se></property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkStack" id="stack">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="transition_duration">128</property>
- <property name="transition_type">crossfade</property>
- <signal name="notify::visible-child" handler="on_stack_visible_child_notify"
swapped="no"/>
+ <property name="orientation">vertical</property>
<child>
- <placeholder/>
+ <object class="GladeAdaptorChooser" id="adaptor_chooser">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">2</property>
+ <property name="spacing">4</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkStack" id="stack">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="transition_duration">128</property>
+ <property name="transition_type">crossfade</property>
+ <signal name="notify::visible-child" handler="on_stack_visible_child_notify"
swapped="no"/>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
<packing>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]