Commit 7988d47d authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

[osx] Add inline stack switcher for side panel

parent 1209e466
......@@ -41,8 +41,10 @@ struct _GeditWindowPrivate
GeditMultiNotebook *multi_notebook;
GtkWidget *side_panel_box;
GtkWidget *side_panel;
GtkWidget *side_stack_switcher;
GtkWidget *side_panel_inline_stack_switcher;
GtkWidget *bottom_panel_box;
GtkWidget *bottom_panel;
......
......@@ -465,7 +465,9 @@ gedit_window_class_init (GeditWindowClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, open_button);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, gear_button);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, hpaned);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, side_panel_box);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, side_panel);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, side_panel_inline_stack_switcher);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, vpaned);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, multi_notebook);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, bottom_panel_box);
......@@ -2364,7 +2366,10 @@ on_side_panel_stack_children_number_changed (GtkStack *stack,
if (children != NULL && children->next != NULL)
{
gtk_widget_show (priv->side_stack_switcher);
#ifndef OS_OSX
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (priv->side_headerbar), priv->side_stack_switcher);
#endif
}
else
{
......@@ -2382,12 +2387,23 @@ setup_side_panel (GeditWindow *window)
gedit_debug (DEBUG_WINDOW);
g_object_bind_property (window->priv->side_panel,
"visible",
window->priv->side_panel_box,
"visible",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
g_signal_connect_after (priv->side_panel,
"notify::visible",
G_CALLBACK (side_panel_visibility_changed),
window);
#ifdef OS_OSX
priv->side_stack_switcher = priv->side_panel_inline_stack_switcher;
#else
priv->side_stack_switcher = gedit_menu_stack_switcher_new ();
#endif
gtk_button_set_relief (GTK_BUTTON (priv->side_stack_switcher), GTK_RELIEF_NONE);
g_object_ref_sink (priv->side_stack_switcher);
......
......@@ -130,3 +130,13 @@ GtkEntry
{
font-family: "Helvetica";
}
GeditMenuStackSwitcher.gedit-side-panel-stack-switcher
{
-GtkButton-default-border: 0;
-GtkButton-default-outside-border: 0;
-GtkButton-inner-border: 0;
-GtkWidget-focus-line-width: 0;
-GtkWidget-focus-padding: 0;
padding: 1px 8px 2px 4px;
}
......@@ -152,8 +152,28 @@
<class name="gedit-side-panel-paned"/>
</style>
<child>
<object class="GtkStack" id="side_panel">
<property name="visible">False</property>
<object class="GtkBox" id="side_panel_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkStack" id="side_panel">
<property name="visible">False</property>
</object>
</child>
<child>
<object class="GeditMenuStackSwitcher" id="side_panel_inline_stack_switcher">
<property name="visible">False</property>
<property name="stack">side_panel</property>
<style>
<class name="gedit-side-panel-stack-switcher"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="resize">False</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