diff options
author | Stefano Karapetsas <[email protected]> | 2013-05-02 17:25:48 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-05-02 17:25:48 +0200 |
commit | 77059fb092a44f1a9c8c5c5e888899028458ff10 (patch) | |
tree | b98ff9b3a4d7cf469dae95390250ef53fcea53c4 | |
parent | ab44cdabc2a7f273eb1bb4098c2cd62980db63f9 (diff) | |
download | mate-panel-77059fb092a44f1a9c8c5c5e888899028458ff10.tar.bz2 mate-panel-77059fb092a44f1a9c8c5c5e888899028458ff10.tar.xz |
Allow to set panel orientation only for expanded panels
Also fix initial position of non-expanded panels
-rw-r--r-- | mate-panel/panel-properties-dialog.c | 27 | ||||
-rw-r--r-- | mate-panel/panel-toplevel.c | 2 |
2 files changed, 23 insertions, 6 deletions
diff --git a/mate-panel/panel-properties-dialog.c b/mate-panel/panel-properties-dialog.c index 6c0f7a24..596ab062 100644 --- a/mate-panel/panel-properties-dialog.c +++ b/mate-panel/panel-properties-dialog.c @@ -145,6 +145,24 @@ panel_properties_dialog_orientation_changed (PanelPropertiesDialog *dialog, } static void +panel_properties_dialog_setup_orientation_combo_sensitivty (PanelPropertiesDialog *dialog, GtkToggleButton *n) +{ + gboolean expand; + expand = panel_profile_get_toplevel_expand (dialog->toplevel); + + if (! panel_profile_key_is_writable (dialog->toplevel, PANEL_TOPLEVEL_ORIENTATION_KEY)) { + gtk_widget_set_sensitive (dialog->orientation_combo, FALSE); + gtk_widget_set_sensitive (dialog->orientation_label, FALSE); + gtk_widget_show (dialog->writability_warn_general); + } + else { + /* enable orientation only for non-expanded panels */ + gtk_widget_set_sensitive (dialog->orientation_combo, expand); + gtk_widget_set_sensitive (dialog->orientation_label, expand); + } +} + +static void panel_properties_dialog_setup_orientation_combo (PanelPropertiesDialog *dialog, GtkBuilder *gui) { @@ -189,11 +207,7 @@ panel_properties_dialog_setup_orientation_combo (PanelPropertiesDialog *dialog, G_CALLBACK (panel_properties_dialog_orientation_changed), dialog); - if (! panel_profile_key_is_writable (dialog->toplevel, PANEL_TOPLEVEL_ORIENTATION_KEY)) { - gtk_widget_set_sensitive (dialog->orientation_combo, FALSE); - gtk_widget_set_sensitive (dialog->orientation_label, FALSE); - gtk_widget_show (dialog->writability_warn_general); - } + panel_properties_dialog_setup_orientation_combo_sensitivty (dialog, NULL); } static void @@ -868,6 +882,9 @@ panel_properties_dialog_new (PanelToplevel *toplevel, panel_properties_dialog_setup_hidebuttons_toggle (dialog, gui); panel_properties_dialog_setup_arrows_toggle (dialog, gui); + g_signal_connect_swapped (dialog->expand_toggle, "toggled", + G_CALLBACK (panel_properties_dialog_setup_orientation_combo_sensitivty), dialog); + panel_properties_update_arrows_toggle_visible ( dialog, GTK_TOGGLE_BUTTON (dialog->hidebuttons_toggle)); g_signal_connect_swapped (dialog->hidebuttons_toggle, "toggled", diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c index 47b87021..692ca441 100644 --- a/mate-panel/panel-toplevel.c +++ b/mate-panel/panel-toplevel.c @@ -4669,7 +4669,7 @@ panel_toplevel_set_expand (PanelToplevel *toplevel, toplevel->priv->expand = expand; - if (!toplevel->priv->expand) { + if (!toplevel->priv->expand && toplevel->priv->updated_geometry_initial) { switch (toplevel->priv->orientation) { case PANEL_ORIENTATION_TOP: panel_toplevel_set_x (toplevel, 0, -1, TRUE); |