~smspillaz/unity/untiy.less-paint-insanity

« back to all changes in this revision

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

  • Committer: Daniel van Vugt
  • Date: 2012-03-14 06:24:18 UTC
  • mfrom: (2108 unity)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: daniel.van.vugt@canonical.com-20120314062418-nprucpbr0m7qky5e
MergedĀ latestĀ lp:unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
#include "UScreen.h"
49
49
 
50
 
#define WINDOW_TITLE_FONT_KEY "/apps/metacity/general/titlebar_font"
51
 
 
52
50
namespace unity
53
51
{
54
52
 
 
53
namespace
 
54
{
 
55
  const std::string WINDOW_TITLE_FONT_KEY = "/apps/metacity/general/titlebar_font";
 
56
}
 
57
 
55
58
PanelMenuView::PanelMenuView(int padding)
56
59
  : _matcher(bamf_matcher_get_default()),
57
60
    _title_layer(nullptr),
58
61
    _util_cg(CAIRO_FORMAT_ARGB32, 1, 1),
59
62
    _gradient_texture(nullptr),
60
63
    _is_inside(false),
 
64
    _is_grabbed(false),
61
65
    _is_maximized(false),
62
66
    _is_own_window(false),
63
67
    _last_active_view(nullptr),
155
159
 
156
160
  // Register for all the interesting events
157
161
  UBusServer* ubus = ubus_server_get_default();
158
 
  _ubus_interests.push_back(ubus_server_register_interest(ubus, UBUS_PLACE_VIEW_SHOWN,
 
162
  _ubus_interests.push_back(ubus_server_register_interest(ubus, UBUS_OVERLAY_SHOWN,
159
163
                                                          (UBusCallback)PanelMenuView::OnPlaceViewShown,
160
164
                                                          this));
161
 
  _ubus_interests.push_back(ubus_server_register_interest(ubus, UBUS_PLACE_VIEW_HIDDEN,
 
165
  _ubus_interests.push_back(ubus_server_register_interest(ubus, UBUS_OVERLAY_HIDDEN,
162
166
                                                          (UBusCallback)PanelMenuView::OnPlaceViewHidden,
163
167
                                                          this));
164
168
 
255
259
{
256
260
  bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);
257
261
 
258
 
  if (mouse_inside == false)
 
262
  if (!mouse_inside)
259
263
    return nullptr;
260
264
 
261
265
  Area* found_area = nullptr;
772
776
 
773
777
    g_object_get(settings, "gtk-xft-dpi", &dpi, nullptr);
774
778
 
775
 
    font_description = gconf_client_get_string(client, WINDOW_TITLE_FONT_KEY, nullptr);
 
779
    font_description = gconf_client_get_string(client, WINDOW_TITLE_FONT_KEY.c_str(), nullptr);
776
780
    desc = pango_font_description_from_string(font_description);
777
781
 
778
782
    if (font_desc)
784
788
      y -= ((unsigned int)(size - 9)) / 2;
785
789
 
786
790
      size += increase_size;
787
 
      
 
791
 
788
792
      char* description = g_strdup_printf("%s %d", font_desc, size);
789
793
      pango_font_description_free(desc);
790
794
      desc = pango_font_description_from_string(description);
1641
1645
void
1642
1646
PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
1643
1647
{
1644
 
  if (_is_inside != true)
 
1648
  if (!_is_inside)
1645
1649
  {
1646
1650
    if (_is_grabbed)
1647
1651
      _is_grabbed = false;
1655
1659
void
1656
1660
PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
1657
1661
{
1658
 
  if (_is_inside != false)
 
1662
  if (_is_inside)
1659
1663
  {
1660
1664
    _is_inside = false;
1661
1665
    FullRedraw();