~feng-kylin/unity/unityshell-rotated-kylin

« back to all changes in this revision

Viewing changes to launcher/SwitcherView.cpp

  • Committer: handsome_feng
  • Date: 2015-12-23 01:13:33 UTC
  • mfrom: (3999.2.68 unity)
  • Revision ID: 445865575@qq.com-20151223011333-gm1y3os6xzdzfstb
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "unity-shared/IconRenderer.h"
25
25
#include "unity-shared/TimeUtil.h"
26
26
#include "unity-shared/UScreen.h"
 
27
#include "unity-shared/XKeyboardUtil.h"
27
28
 
28
29
#include <Nux/Nux.h>
29
30
 
72
73
  , last_detail_icon_selected_(-1)
73
74
  , last_mouse_scroll_time_(0)
74
75
  , check_mouse_first_time_(true)
 
76
  , key_right_to_tab_(NUX_VK_q)
75
77
{
76
78
  icon_renderer_->pip_style = OVER_TILE;
77
79
  icon_renderer_->monitor = monitors::MAX;
105
107
    return geo;
106
108
  });
107
109
 
 
110
  if (Display* dpy = nux::GetGraphicsDisplay()->GetX11Display())
 
111
  {
 
112
    KeySym sym = keyboard::get_key_right_to_key_symbol(dpy, XStringToKeysym("Tab"));
 
113
 
 
114
    if (sym != NoSymbol)
 
115
      key_right_to_tab_ = sym;
 
116
  }
 
117
 
108
118
  animation_.updated.connect(sigc::hide(sigc::mem_fun(this, &SwitcherView::PreLayoutManagement)));
109
119
}
110
120
 
165
175
  model->selection_changed.connect(sigc::mem_fun(this, &SwitcherView::OnSelectionChanged));
166
176
  model->detail_selection.changed.connect (sigc::mem_fun (this, &SwitcherView::OnDetailSelectionChanged));
167
177
  model->detail_selection_index.changed.connect (sigc::mem_fun (this, &SwitcherView::OnDetailSelectionIndexChanged));
 
178
  model->updated.connect(sigc::mem_fun(this, &SwitcherView::QueueRelayout));
168
179
 
169
180
  last_icon_selected_ = -1;
170
181
 
500
511
        switcher_start_detail.emit();
501
512
        break;
502
513
      default:
503
 
        return false;
504
 
        break;
 
514
        if (keysym == key_right_to_tab_)
 
515
          switcher_close_current.emit();
505
516
    }
506
517
  }
507
518
 
593
604
 
594
605
  for (Window window : xids)
595
606
  {
 
607
    bool selected = (window == model_->DetailSelectionWindow());
596
608
    auto layout_window = std::make_shared<LayoutWindow>(window);
597
 
    bool selected = (window == model_->DetailSelectionWindow());
 
609
    layout_window->ComputeDecorationHeight();
598
610
    layout_window->selected = selected;
599
611
    layout_window->alpha = (selected ? 1.0f : 0.9f) * progress;
600
612
 
648
660
  nux::Geometry const& base = GetGeometry();
649
661
  nux::Size result(base.width - border_size * 2, base.height - border_size * 2);
650
662
 
651
 
  int width_padding = std::max(model_->Size() - 1, 0) * minimum_spacing + tile_size;
 
663
  int width_padding = std::max<int>(model_->Size() - 1, 0) * minimum_spacing + tile_size;
652
664
  result.width -= width_padding;
653
665
 
654
666
  return result;