Commit a6278b2a authored by Christian Hergert's avatar Christian Hergert
Browse files

omnibar: stub out some popover items

parent bc2c2b98
......@@ -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
......
......@@ -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>
......
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