~macslow/unity/backported-remote-add-to-5.0

« back to all changes in this revision

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

Merging with upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
UBusManager HudLauncherIcon::ubus_manager_;
40
40
 
41
41
HudLauncherIcon::HudLauncherIcon(LauncherHideMode hide_mode)
42
 
 : SimpleLauncherIcon()
 
42
 : SingleMonitorLauncherIcon(0)
43
43
 , launcher_hide_mode_(hide_mode)
44
44
{
45
45
  tooltip_text = _("HUD");
47
47
  SetQuirk(QUIRK_VISIBLE, false);
48
48
  SetQuirk(QUIRK_RUNNING, false);
49
49
  SetQuirk(QUIRK_ACTIVE, true);
50
 
  SetIconType(TYPE_HOME);
 
50
  SetIconType(TYPE_HUD);
51
51
 
52
52
  background_color_ = nux::color::White;
53
53
 
74
74
 
75
75
void HudLauncherIcon::SetHideMode(LauncherHideMode hide_mode)
76
76
{
77
 
  launcher_hide_mode_ = hide_mode;
 
77
  if (launcher_hide_mode_ != hide_mode)
 
78
  {
 
79
    launcher_hide_mode_ = hide_mode;
 
80
 
 
81
    if (launcher_hide_mode_ == LAUNCHER_HIDE_AUTOHIDE)
 
82
      SetQuirk(QUIRK_VISIBLE, false);
 
83
  }
78
84
}
79
85
 
80
86
void HudLauncherIcon::OnOverlayShown(GVariant* data, bool visible)
86
92
                &overlay_identity, &can_maximise, &overlay_monitor);
87
93
 
88
94
  // If the hud is open, we show the HUD button iff we have a locked launcher
89
 
  if (!g_strcmp0(overlay_identity, "hud") &&
 
95
  if (overlay_identity.Str() == "hud" &&
90
96
      launcher_hide_mode_ == LAUNCHER_HIDE_NEVER)
91
97
  {
 
98
    SetMonitor(overlay_monitor);
92
99
    SetQuirk(QUIRK_VISIBLE, visible);
 
100
    SetQuirk(QUIRK_ACTIVE, visible);
93
101
    EmitNeedsRedraw();
94
102
  }
95
103
}