summaryrefslogtreecommitdiff
diff options
authorhandsome_feng <445865575@qq.com>2016-05-17 02:56:14 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2016-05-17 02:56:14 +0000
commit8c7391fbe65d828a6ca53a3ace4c2f133c7618d7 (patch)
treec2ed6b1077e9138a239263e5e9fe0b260f4b8708
parent24524d61be665787fe9d87c7510f4402917f4aa7 (diff)
parent2b37f43a9fce615b13b5f6cc5d4b876430689a70 (diff)
Change the x_offset of expo when launcher position changed. Fixes: #1562348, #1573897
Approved by: Eleni Maria Stea (bzr r4118)
-rw-r--r--plugins/unityshell/src/unityshell.cpp51
1 files changed, 45 insertions, 6 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 2237706fa..f0c24f340 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -3623,7 +3623,17 @@ void UnityScreen::optionChanged(CompOption* opt, UnityshellOptions::Options num)
int scale_offset = (launcher_options->hide_mode == LAUNCHER_HIDE_NEVER) ? 0 : launcher_controller_->launcher().GetWidth();
CompOption::Value v(scale_offset);
- screen->setOptionForPlugin("scale", "x_offset", v);
+ CompOption::Value bv(0);
+ if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
+ {
+ screen->setOptionForPlugin("scale", "x_offset", v);
+ screen->setOptionForPlugin("scale", "y_bottom_offset", bv);
+ }
+ else
+ {
+ screen->setOptionForPlugin("scale", "x_offset", bv);
+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
+ }
break;
}
case UnityshellOptions::BacklightMode:
@@ -3834,11 +3844,19 @@ bool UnityScreen::layoutSlotsAndAssignWindows()
}
auto max_bounds = NuxGeometryFromCompRect(output.workArea());
- if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER && Settings::Instance().launcher_position() == LauncherPosition::LEFT)
+ if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER)
{
- int monitor_width = unity_settings_.LauncherSize(monitor);
- max_bounds.x += monitor_width;
- max_bounds.width -= monitor_width;
+ if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
+ {
+ int monitor_width = unity_settings_.LauncherSize(monitor);
+ max_bounds.x += monitor_width;
+ max_bounds.width -= monitor_width;
+ }
+ else if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
+ {
+ int launcher_size = unity_settings_.LauncherSize(monitor);
+ max_bounds.height -= launcher_size;
+ }
}
nux::Geometry final_bounds;
@@ -4098,15 +4116,32 @@ void UnityScreen::InitUnityComponents()
adjustment_x = launcher_size;
shortcut_controller_->SetAdjustment(adjustment_x, panel_style_.PanelHeight(launcher->monitor));
+ CompOption::Value v(launcher_size);
if (launcher_position == LauncherPosition::LEFT)
{
- CompOption::Value v(launcher_size);
screen->setOptionForPlugin("expo", "x_offset", v);
if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
v.set(0);
screen->setOptionForPlugin("scale", "x_offset", v);
+
+ v.set(0);
+ screen->setOptionForPlugin("expo", "y_bottom_offset", v);
+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
+ }
+ else
+ {
+ screen->setOptionForPlugin("expo", "y_bottom_offset", v);
+
+ if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
+ v.set(0);
+
+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
+
+ v.set(0);
+ screen->setOptionForPlugin("expo", "x_offset", v);
+ screen->setOptionForPlugin("scale", "x_offset", v);
}
};
@@ -4124,6 +4159,10 @@ void UnityScreen::InitUnityComponents()
check_launchers_size();
});
+ Settings::Instance().launcher_position.changed.connect([this, check_launchers_size] (LauncherPosition const&) {
+ check_launchers_size();
+ });
+
check_launchers_size();
launcher_controller_->options()->scroll_inactive_icons = optionGetScrollInactiveIcons();