~azzar1/unity/fix-lp-1587507

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/unityshell.cpp

  • Committer: handsome_feng
  • Date: 2016-05-11 09:19:36 UTC
  • mto: This revision was merged to the branch mainline in revision 4118.
  • Revision ID: 445865575@qq.com-20160511091936-ltol8n1nyhpnc6oe
Added y_bottom_offset to expo and scale plugins

Show diffs side-by-side

added added

removed removed

Lines of Context:
3623
3623
 
3624
3624
      int scale_offset = (launcher_options->hide_mode == LAUNCHER_HIDE_NEVER) ? 0 : launcher_controller_->launcher().GetWidth();
3625
3625
      CompOption::Value v(scale_offset);
3626
 
      screen->setOptionForPlugin("scale", "x_offset", v);
 
3626
      CompOption::Value bv(0);
 
3627
      if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
 
3628
      {
 
3629
        screen->setOptionForPlugin("scale", "x_offset", v);
 
3630
        screen->setOptionForPlugin("scale", "y_bottom_offset", bv);
 
3631
      }
 
3632
      else
 
3633
      {
 
3634
        screen->setOptionForPlugin("scale", "x_offset", bv);
 
3635
        screen->setOptionForPlugin("scale", "y_bottom_offset", v);
 
3636
      }
3627
3637
      break;
3628
3638
    }
3629
3639
    case UnityshellOptions::BacklightMode:
3834
3844
    }
3835
3845
 
3836
3846
    auto max_bounds = NuxGeometryFromCompRect(output.workArea());
3837
 
    if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER && Settings::Instance().launcher_position() == LauncherPosition::LEFT)
 
3847
    if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER)
3838
3848
    {
3839
 
      int monitor_width = unity_settings_.LauncherSize(monitor);
3840
 
      max_bounds.x += monitor_width;
3841
 
      max_bounds.width -= monitor_width;
 
3849
      if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
 
3850
      {
 
3851
        int monitor_width = unity_settings_.LauncherSize(monitor);
 
3852
        max_bounds.x += monitor_width;
 
3853
        max_bounds.width -= monitor_width;
 
3854
      }
 
3855
      else if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
 
3856
      {
 
3857
        int launcher_size = unity_settings_.LauncherSize(monitor);
 
3858
        max_bounds.height -= launcher_size;
 
3859
      }
3842
3860
    }
3843
3861
 
3844
3862
    nux::Geometry final_bounds;
4099
4117
    shortcut_controller_->SetAdjustment(adjustment_x, panel_style_.PanelHeight(launcher->monitor));
4100
4118
 
4101
4119
    CompOption::Value v(launcher_size);
4102
 
    if (launcher_position == LauncherPosition::BOTTOM)
4103
 
      v.set(0);
4104
 
 
4105
 
    screen->setOptionForPlugin("expo", "x_offset", v);
4106
 
 
4107
 
    if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
4108
 
      v.set(0);
4109
 
 
4110
 
    screen->setOptionForPlugin("scale", "x_offset", v);
 
4120
    if (launcher_position == LauncherPosition::LEFT)
 
4121
    {
 
4122
      screen->setOptionForPlugin("expo", "x_offset", v);
 
4123
 
 
4124
      if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
 
4125
        v.set(0);
 
4126
 
 
4127
      screen->setOptionForPlugin("scale", "x_offset", v);
 
4128
 
 
4129
      v.set(0);
 
4130
      screen->setOptionForPlugin("expo", "y_bottom_offset", v);
 
4131
      screen->setOptionForPlugin("scale", "y_bottom_offset", v);
 
4132
    }
 
4133
    else
 
4134
    {
 
4135
      screen->setOptionForPlugin("expo", "y_bottom_offset", v);
 
4136
 
 
4137
      if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
 
4138
        v.set(0);
 
4139
 
 
4140
      screen->setOptionForPlugin("scale", "y_bottom_offset", v);
 
4141
 
 
4142
      v.set(0);
 
4143
      screen->setOptionForPlugin("expo", "x_offset", v);
 
4144
      screen->setOptionForPlugin("scale", "x_offset", v);
 
4145
    }
4111
4146
  };
4112
4147
 
4113
4148
  auto check_launchers_size = [this, on_launcher_size_changed] {