Commit 6cef60a7 authored by Robert Roth's avatar Robert Roth

Added top panel with headerbar contents to fallback to

parent 7484244e
...@@ -60,6 +60,43 @@ ...@@ -60,6 +60,43 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="header_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<property name="hexpand">True</property>
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
<object class="GtkStackSwitcher" id="stack_switcher2">
<property name="visible">True</property>
<property name="stack">stack</property>
<property name="halign">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="search_button2">
<property name="visible">True</property>
<property name="action_name">win.search</property>
<child>
<object class="GtkImage" id="search_image2">
<property name="visible">True</property>
<property name="icon_size">1</property>
<property name="icon_name">edit-find-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
</child>
<child> <child>
<object class="GtkStack" id="stack"> <object class="GtkStack" id="stack">
<property name="visible">True</property> <property name="visible">True</property>
......
...@@ -575,6 +575,7 @@ create_main_window (GsmApplication *app) ...@@ -575,6 +575,7 @@ create_main_window (GsmApplication *app)
GtkWidget *stack; GtkWidget *stack;
GtkWidget *process_menu_button; GtkWidget *process_menu_button;
GMenuModel *process_menu_model; GMenuModel *process_menu_model;
GtkWidget *header_box;
int width, height, xpos, ypos; int width, height, xpos, ypos;
...@@ -602,9 +603,18 @@ create_main_window (GsmApplication *app) ...@@ -602,9 +603,18 @@ create_main_window (GsmApplication *app)
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (process_menu_button), process_menu_model); gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (process_menu_button), process_menu_model);
app->end_process_button = GTK_WIDGET (gtk_builder_get_object (builder, "end_process_button")); app->end_process_button = GTK_WIDGET (gtk_builder_get_object (builder, "end_process_button"));
header_box = GTK_WIDGET (gtk_builder_get_object(builder, "header_box"));
app->search_button = GTK_WIDGET (gtk_builder_get_object (builder, "search_button")); GtkSettings *gtk_settings = gtk_settings_get_default ();
GValue alternative_ui = G_VALUE_INIT;
g_value_init (&alternative_ui, G_TYPE_BOOLEAN);
g_object_get_property (G_OBJECT (gtk_settings), "gtk-shell-shows-menubar", &alternative_ui);
if (!g_value_get_boolean (&alternative_ui)) {
app->search_button = GTK_WIDGET (gtk_builder_get_object (builder, "search_button"));
//gtk_widget_set_visible (header_box, FALSE);
} else {
app->search_button = GTK_WIDGET (gtk_builder_get_object (builder, "search_button2"));
}
GActionEntry win_action_entries[] = { GActionEntry win_action_entries[] = {
{ "about", on_activate_about, NULL, NULL, NULL }, { "about", on_activate_about, NULL, NULL, NULL },
{ "search", on_activate_toggle, NULL, "false", NULL }, { "search", on_activate_toggle, NULL, "false", NULL },
......
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