[gnome-builder] glade: add adapter chooser
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] glade: add adapter chooser
- Date: Sat, 20 Oct 2018 15:23:32 +0000 (UTC)
commit 95ccaa3d24326e3704edcb3682a53b217304e732
Author: Christian Hergert <chergert redhat com>
Date: Sat Oct 20 08:23:20 2018 -0700
glade: add adapter chooser
src/plugins/glade/gbp-glade-private.h | 10 ++++++----
src/plugins/glade/gbp-glade-view.c | 18 +++++++++++++++++-
src/plugins/glade/themes/Adwaita-shared.css | 10 ++++++++++
3 files changed, 33 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/glade/gbp-glade-private.h b/src/plugins/glade/gbp-glade-private.h
index f4abf2bfe..b66bb3008 100644
--- a/src/plugins/glade/gbp-glade-private.h
+++ b/src/plugins/glade/gbp-glade-private.h
@@ -22,6 +22,7 @@
#include <ide.h>
#include <gladeui/glade.h>
+#include <gladeui/glade-adaptor-chooser.h>
#include "gbp-glade-view.h"
@@ -29,10 +30,11 @@ G_BEGIN_DECLS
struct _GbpGladeView
{
- IdeLayoutView parent_instance;
- GFile *file;
- GladeProject *project;
- GladeDesignView *designer;
+ IdeLayoutView parent_instance;
+ GFile *file;
+ GladeProject *project;
+ GladeDesignView *designer;
+ GladeAdaptorChooser *chooser;
};
void _gbp_glade_view_init_actions (GbpGladeView *self);
diff --git a/src/plugins/glade/gbp-glade-view.c b/src/plugins/glade/gbp-glade-view.c
index 1f505f2a6..1eeb541b6 100644
--- a/src/plugins/glade/gbp-glade-view.c
+++ b/src/plugins/glade/gbp-glade-view.c
@@ -66,19 +66,35 @@ gbp_glade_view_class_init (GbpGladeViewClass *klass)
static void
gbp_glade_view_init (GbpGladeView *self)
{
+ GtkBox *box;
+
ide_layout_view_set_menu_id (IDE_LAYOUT_VIEW (self), "gbp-glade-view-menu");
ide_layout_view_set_title (IDE_LAYOUT_VIEW (self), _("Unnamed Glade project"));
ide_layout_view_set_icon_name (IDE_LAYOUT_VIEW (self), "glade-symbolic");
ide_layout_view_set_menu_id (IDE_LAYOUT_VIEW (self), "gbp-glade-view-document-menu");
self->project = glade_project_new ();
+
+ box = g_object_new (GTK_TYPE_BOX,
+ "orientation", GTK_ORIENTATION_VERTICAL,
+ "visible", TRUE,
+ NULL);
+ gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (box));
+
+ self->chooser = g_object_new (GLADE_TYPE_ADAPTOR_CHOOSER,
+ "project", self->project,
+ "visible", TRUE,
+ NULL);
+ dzl_gtk_widget_add_style_class (GTK_WIDGET (self->chooser), "glade-chooser");
+ gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (self->chooser));
+
self->designer = g_object_new (GLADE_TYPE_DESIGN_VIEW,
"project", self->project,
"vexpand", TRUE,
"visible", TRUE,
NULL);
dzl_gtk_widget_add_style_class (GTK_WIDGET (self->designer), "glade-designer");
- gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->designer));
+ gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (self->designer));
glade_app_add_project (self->project);
diff --git a/src/plugins/glade/themes/Adwaita-shared.css b/src/plugins/glade/themes/Adwaita-shared.css
index 600aafbdb..0b07468ee 100644
--- a/src/plugins/glade/themes/Adwaita-shared.css
+++ b/src/plugins/glade/themes/Adwaita-shared.css
@@ -35,3 +35,13 @@ gbpgladeproperties button.combo {
min-height: 18px;
padding: 2px;
}
+
+.glade-chooser button {
+ min-height: 12px;
+ min-width: 12px;
+}
+
+.glade-chooser {
+ font-size: 0.8333em;
+ padding: 6px;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]