diff options
| author | handsome_feng <445865575@qq.com> | 2015-11-04 16:54:13 +0800 | 
|---|---|---|
| committer | handsome_feng <445865575@qq.com> | 2015-11-04 16:54:13 +0800 | 
| commit | b21cd4c3c835a574f771e2b8b62c5735b8536e76 (patch) | |
| tree | 1a5cbdd89c3e83f9dcb84101974c2a8ca1788b30 /hud | |
| parent | 7387f499e38bb1cba95c908fb280dc59bc726afd (diff) | |
Added the launcher position setting in UnitySettings.
(bzr r3999.7.2)
Diffstat (limited to 'hud')
| -rw-r--r-- | hud/HudController.cpp | 16 | 
1 files changed, 12 insertions, 4 deletions
| diff --git a/hud/HudController.cpp b/hud/HudController.cpp index 4f39477bf..b318af88a 100644 --- a/hud/HudController.cpp +++ b/hud/HudController.cpp @@ -206,13 +206,19 @@ void Controller::EnsureHud()  void Controller::SetIcon(std::string const& icon_name)  {  LOG_DEBUG(logger) << "setting icon to - " << icon_name; - int launcher_width = unity::Settings::Instance().LauncherWidth(monitor_index_); + int launcher_size; + if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) + launcher_size = unity::Settings::Instance().LauncherWidth(monitor_index_); + else + launcher_size = unity::Settings::Instance().LauncherHeight(monitor_index_); + + std::cout << "HudController(216): " << unity::Settings::Instance().LauncherWidth(monitor_index_) << ":" << unity::Settings::Instance().LauncherHeight(monitor_index_) << std::endl;  if (view_)  {  double scale = view_->scale();  int tsize = tile_size().CP(scale); - view_->SetIcon(icon_name, tsize, icon_size().CP(scale), launcher_width - tsize); + view_->SetIcon(icon_name, tsize, icon_size().CP(scale), launcher_size - tsize);  }  ubus.SendMessage(UBUS_HUD_ICON_CHANGED, g_variant_new_string(icon_name.c_str())); @@ -253,7 +259,8 @@ nux::Geometry Controller::GetIdealWindowGeometry()  if (IsLockedToLauncher(ideal_monitor))  { - int launcher_width = unity::Settings::Instance().LauncherWidth(ideal_monitor); +// int launcher_width = unity::Settings::Instance().LauncherWidth(ideal_monitor); + int launcher_width = 20;  geo.x += launcher_width;  geo.width -= launcher_width;  } @@ -269,7 +276,8 @@ void Controller::Relayout(bool check_monitor)  monitor_index_ = CLAMP(GetIdealMonitor(), 0, static_cast<int>(UScreen::GetDefault()->GetMonitors().size()-1));  nux::Geometry const& geo = GetIdealWindowGeometry(); - int launcher_width = unity::Settings::Instance().LauncherWidth(monitor_index_); +// int launcher_width = unity::Settings::Instance().LauncherWidth(monitor_index_); + int launcher_width = 20;  view_->QueueDraw();  window_->SetGeometry(geo); | 
