Commit 370ca961 authored by Christian Hergert's avatar Christian Hergert
Browse files

omnibar: show build mode in popover

Also make sure we properly switch back to "Last Build" when necessary.
parent 75e61ab6
......@@ -18,6 +18,7 @@
#define G_LOG_DOMAIN "ide-omni-bar"
#include <glib/gi18n.h>
#include <egg-signal-group.h>
#include "ide-context.h"
......@@ -56,9 +57,8 @@ struct _IdeOmniBar
GtkPopover *popover;
GtkLabel *popover_branch_label;
GtkButton *popover_build_cancel_button;
GtkLabel *popover_build_label;
GtkLabel *popover_build_mode_label;
GtkLabel *popover_build_running_time_label;
GtkLabel *popover_build_status;
GtkListBox *popover_configuration_list_box;
GtkLabel *popover_last_build_time_label;
GtkButton *popover_view_output_button;
......@@ -316,7 +316,11 @@ ide_omni_bar_build_result_notify_mode (IdeOmniBar *self,
mode = ide_build_result_get_mode (result);
gtk_label_set_label (self->build_result_mode_label, mode);
gtk_label_set_label (self->popover_build_status, mode);
if (ide_build_result_get_running (result))
gtk_label_set_label (self->popover_build_mode_label, mode);
else
gtk_label_set_label (self->popover_build_mode_label, _("Last Build"));
}
static void
......@@ -364,9 +368,10 @@ ide_omni_bar_build_result_notify_running (IdeOmniBar *self,
gtk_stack_set_visible_child (self->message_stack,
GTK_WIDGET (self->build_result_mode_label));
gtk_widget_show (GTK_WIDGET (self->popover_build_cancel_button));
gtk_widget_hide (GTK_WIDGET (self->popover_build_status));
gtk_widget_hide (GTK_WIDGET (self->popover_last_build_time_label));
gtk_widget_show (GTK_WIDGET (self->popover_build_cancel_button));
gtk_widget_show (GTK_WIDGET (self->popover_build_mode_label));
gtk_widget_show (GTK_WIDGET (self->popover_build_running_time_label));
}
else
......@@ -378,11 +383,13 @@ ide_omni_bar_build_result_notify_running (IdeOmniBar *self,
"action-name", "build-tools.build",
NULL);
gtk_label_set_label (self->popover_build_mode_label, _("Last Build"));
gtk_widget_hide (GTK_WIDGET (self->popover_build_cancel_button));
gtk_widget_show (GTK_WIDGET (self->popover_build_label));
gtk_widget_show (GTK_WIDGET (self->popover_build_status));
gtk_widget_show (GTK_WIDGET (self->popover_last_build_time_label));
gtk_widget_hide (GTK_WIDGET (self->popover_build_running_time_label));
gtk_widget_show (GTK_WIDGET (self->popover_build_mode_label));
gtk_widget_show (GTK_WIDGET (self->popover_last_build_time_label));
}
}
......@@ -522,9 +529,8 @@ ide_omni_bar_class_init (IdeOmniBarClass *klass)
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_branch_label);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_build_cancel_button);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_build_label);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_build_mode_label);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_build_running_time_label);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_build_status);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_configuration_list_box);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_last_build_time_label);
gtk_widget_class_bind_template_child (widget_class, IdeOmniBar, popover_project_label);
......
......@@ -230,8 +230,7 @@
<property name="valign">center</property>
<property name="visible">true</property>
<child>
<object class="GtkLabel" id="popover_build_label">
<property name="label">Last build</property>
<object class="GtkLabel" id="popover_build_mode_label">
<property name="xalign">0.0</property>
<attributes>
<attribute name="weight" value="bold"/>
......@@ -250,6 +249,7 @@
</child>
<child>
<object class="GtkLabel" id="popover_build_running_time_label">
<property name="xalign">1.0</property>
<property name="margin-end">8</property>
<property name="margin-start">8</property>
</object>
......@@ -258,16 +258,6 @@
<property name="pack-type">start</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="popover_build_status">
<property name="margin-end">8</property>
<property name="margin-start">8</property>
</object>
<packing>
<property name="position">2</property>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkButton" id="popover_view_output_button">
<property name="action-name">build-tools.view-output</property>
......
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