diff options
| author | handsome_feng <445865575@qq.com> | 2016-01-12 15:43:31 +0800 |
|---|---|---|
| committer | handsome_feng <445865575@qq.com> | 2016-01-12 15:43:31 +0800 |
| commit | a6ec0ea7b641eb4f099c9ccb554fe6ae57016b5e (patch) | |
| tree | 338fa514c4f3c763ede84369bb8fd3348c2c714e /plugins | |
| parent | e74f0043e2c6a44778f0c4ace27bd62bcb1ea2c1 (diff) | |
modified the x_offset for plugin 'expo' and 'scale'
(bzr r3999.7.20)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 471214e7b..2ddf8c6c9 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -4063,25 +4063,31 @@ void UnityScreen::InitUnityComponents() * that must not be considered when drawing an overlay */ auto* launcher = static_cast<Launcher*>(area); - int launcher_size = 0; - if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) - launcher_size = w - (1_em).CP(unity_settings_.em(launcher->monitor)->DPIScale()); + auto launcher_position = Settings::Instance().launcher_position(); + + int size = 0; + if (launcher_position == LauncherPosition::LEFT) + size = w; else - launcher_size = h - (1_em).CP(unity_settings_.em(launcher->monitor)->DPIScale()); + size = h; + int launcher_size = size - (1_em).CP(unity_settings_.em(launcher->monitor)->DPIScale()); unity::Settings::Instance().SetLauncherSize(launcher_size, launcher->monitor); int adjustment_x = 0; - if (Settings::Instance().launcher_position == LauncherPosition::LEFT) + if (launcher_position == LauncherPosition::LEFT) adjustment_x = launcher_size; shortcut_controller_->SetAdjustment(adjustment_x, panel_style_.PanelHeight(launcher->monitor)); - CompOption::Value v(launcher_size); - screen->setOptionForPlugin("expo", "x_offset", v); + 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); + if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER) + v.set(0); - screen->setOptionForPlugin("scale", "x_offset", v); + screen->setOptionForPlugin("scale", "x_offset", v); + } }; auto check_launchers_size = [this, on_launcher_size_changed] { |
