diff options
| author | handsome_feng <445865575@qq.com> | 2015-11-12 15:33:41 +0800 |
|---|---|---|
| committer | handsome_feng <445865575@qq.com> | 2015-11-12 15:33:41 +0800 |
| commit | ba2acaf6c3b5031bef1d565295c3929702d05600 (patch) | |
| tree | 2f7216255a1fe533d4e64d43b91966494bfce77c | |
| parent | 105aac52fecb82a4bcfdaeb748dc4056ea7c1411 (diff) | |
reset the launcher layout dynamically according to the gsettings item launcher-position
(bzr r3999.7.4)
| -rw-r--r-- | launcher/Launcher.cpp | 9 | ||||
| -rw-r--r-- | launcher/Launcher.h | 2 | ||||
| -rw-r--r-- | unity-shared/IconRenderer.cpp | 2 | ||||
| -rw-r--r-- | unity-shared/UnitySettings.cpp | 1 |
4 files changed, 9 insertions, 5 deletions
diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp index 04e6612b0..ee9d31ff1 100644 --- a/launcher/Launcher.cpp +++ b/launcher/Launcher.cpp @@ -189,6 +189,10 @@ Launcher::Launcher(MockableBaseWindow* parent, options.changed.connect(sigc::mem_fun(this, &Launcher::OnOptionsChanged)); monitor.changed.connect(sigc::mem_fun(this, &Launcher::OnMonitorChanged)); + launcher_position_changed_ = unity::Settings::Instance().launcher_position.changed.connect([this] (LauncherPosition) { + OnMonitorChanged(monitor); + QueueDraw(); + }); unity::Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &Launcher::OnDPIChanged)); @@ -1343,9 +1347,7 @@ void Launcher::OnMonitorChanged(int new_monitor) auto monitor_geo = uscreen->GetMonitorGeometry(new_monitor); unity::panel::Style &panel_style = panel::Style::Instance(); int panel_height = panel_style.PanelHeight(new_monitor); -// int launcher_height = unity::Settings::Instance().LauncherSize(new_monitor); - int launcher_height = icon_size_ + ICON_PADDING * 2 + RIGHT_LINE_WIDTH - 2; - //Todo: Get wrong height , need investigate + int launcher_height = unity::Settings::Instance().LauncherSize(new_monitor); cv_ = unity::Settings::Instance().em(monitor); if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) @@ -1364,6 +1366,7 @@ void Launcher::UpdateOptions(Options::Ptr options) SetHideMode(options->hide_mode); SetScrollInactiveIcons(options->scroll_inactive_icons); SetLauncherMinimizeWindow(options->minimize_window_on_click); + OnMonitorChanged(monitor); if (model_) { diff --git a/launcher/Launcher.h b/launcher/Launcher.h index 5847b1394..43d659271 100644 --- a/launcher/Launcher.h +++ b/launcher/Launcher.h @@ -368,6 +368,8 @@ private: BaseTexturePtr launcher_pressure_effect_; BackgroundEffectHelper bg_effect_helper_; + connection::Wrapper launcher_position_changed_; + nux::animation::AnimateValue<float> auto_hide_animation_; nux::animation::AnimateValue<float> hover_animation_; nux::animation::AnimateValue<float> drag_over_animation_; diff --git a/unity-shared/IconRenderer.cpp b/unity-shared/IconRenderer.cpp index 4e1b2b45c..b688a62eb 100644 --- a/unity-shared/IconRenderer.cpp +++ b/unity-shared/IconRenderer.cpp @@ -1109,7 +1109,7 @@ void IconRenderer::RenderIndicators(nux::GraphicsEngine& GfxContext, } int markerY = 0; - if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) { if (pip_style == OUTSIDE_TILE) { diff --git a/unity-shared/UnitySettings.cpp b/unity-shared/UnitySettings.cpp index 12fff7625..351981c2c 100644 --- a/unity-shared/UnitySettings.cpp +++ b/unity-shared/UnitySettings.cpp @@ -114,7 +114,6 @@ public: signals_.Add<void, GSettings*, const gchar*>(usettings_, "changed::" + LAUNCHER_POSITION, [this] (GSettings*, const gchar*) { CacheLauncherPosition(); parent_->launcher_position.changed.emit(cached_launcher_position_); - std::cout << "Unitysettings position changed: " << static_cast<int>(Settings::Instance().launcher_position()) << std::endl; }); signals_.Add<void, GSettings*, const gchar*>(ubuntu_ui_settings_, "changed::" + SCALE_FACTOR, [this] (GSettings*, const gchar* t) { |
