summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mate-panel/panel-properties-dialog.c27
-rw-r--r--mate-panel/panel-toplevel.c2
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);