[gnome-builder] omnibar: stub out some popover items
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] omnibar: stub out some popover items
- Date: Tue, 28 Jun 2016 00:05:48 +0000 (UTC)
commit a6278b2a73c915a256654a7ad7f8511ed2a1654a
Author: Christian Hergert <chergert redhat com>
Date: Thu Jun 23 01:25:57 2016 -0700
omnibar: stub out some popover items
libide/workbench/ide-omni-bar.c | 19 +++++++++++++++-
libide/workbench/ide-omni-bar.ui | 43 ++++++++++++++++++++++++++++++++++++-
2 files changed, 58 insertions(+), 4 deletions(-)
---
diff --git a/libide/workbench/ide-omni-bar.c b/libide/workbench/ide-omni-bar.c
index 617d1ca..792b24d 100644
--- a/libide/workbench/ide-omni-bar.c
+++ b/libide/workbench/ide-omni-bar.c
@@ -51,6 +51,8 @@ struct _IdeOmniBar
GtkLabel *config_name_label;
GtkStack *message_stack;
GtkPopover *popover;
+ GtkLabel *popover_branch_label;
+ GtkLabel *popover_project_label;
};
G_DEFINE_TYPE (IdeOmniBar, ide_omni_bar, GTK_TYPE_BOX)
@@ -80,6 +82,7 @@ ide_omni_bar_update (IdeOmniBar *self)
gtk_label_set_label (self->project_label, project_name);
gtk_label_set_label (self->branch_label, branch_name);
+ gtk_label_set_label (self->popover_branch_label, branch_name);
}
static void
@@ -97,8 +100,18 @@ ide_omni_bar_context_set (GtkWidget *widget,
if (context != NULL)
{
- IdeVcs *vcs = ide_context_get_vcs (context);
- IdeConfigurationManager *configs = ide_context_get_configuration_manager (context);
+ IdeConfigurationManager *configs;
+ g_autofree gchar *path = NULL;
+ GFile *workdir;
+ IdeVcs *vcs;
+
+ configs = ide_context_get_configuration_manager (context);
+ vcs = ide_context_get_vcs (context);
+ workdir = ide_vcs_get_working_directory (vcs);
+
+ /* TODO: Convert to relative path (or remote uri) */
+ path = g_file_get_path (workdir);
+ gtk_label_set_label (self->popover_project_label, path);
g_signal_connect_object (vcs,
"changed",
@@ -313,6 +326,8 @@ ide_omni_bar_class_init (IdeOmniBarClass *klass)
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, message_stack);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, project_label);
+ gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_branch_label);
+ gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_project_label);
}
static void
diff --git a/libide/workbench/ide-omni-bar.ui b/libide/workbench/ide-omni-bar.ui
index c19da0c..8e74625 100644
--- a/libide/workbench/ide-omni-bar.ui
+++ b/libide/workbench/ide-omni-bar.ui
@@ -15,6 +15,8 @@
<object class="GtkBox">
<property name="hexpand">true</property>
<property name="visible">true</property>
+ <property name="margin-end">3</property>
+ <property name="margin-start">3</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="project_label">
@@ -114,20 +116,25 @@
</widgets>
</object>
<object class="GtkPopover" id="popover">
- <property name="border-width">20</property>
+ <property name="border-width">24</property>
<property name="relative-to">event_box</property>
<property name="position">bottom</property>
+ <property name="width-request">400</property>
<child>
<object class="GtkBox">
- <property name="spacing">12</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">20</property>
<property name="visible">true</property>
<child>
<object class="GtkGrid">
+ <property name="column-spacing">20</property>
+ <property name="row-spacing">10</property>
<property name="visible">true</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Project</property>
<property name="visible">true</property>
+ <property name="xalign">0.0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -140,6 +147,8 @@
<object class="GtkLabel" id="popover_project_label">
<property name="hexpand">true</property>
<property name="visible">true</property>
+ <property name="xalign">0.0</property>
+ <property name="ellipsize">start</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -149,6 +158,7 @@
<object class="GtkLabel">
<property name="label" translatable="yes">Branch</property>
<property name="visible">true</property>
+ <property name="xalign">0.0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -165,6 +175,7 @@
<object class="GtkLabel" id="popover_branch_label">
<property name="hexpand">true</property>
<property name="visible">true</property>
+ <property name="xalign">0.0</property>
</object>
<packing>
<property name="left-attach">1</property>
@@ -173,6 +184,34 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">Build Profile</property>
+ <property name="visible">true</property>
+ <property name="xalign">0.0</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="shadow-type">in</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkListBox">
+ <property name="visible">true</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]