Skip to content

Instantly share code, notes, and snippets.

@donadigo
Last active April 30, 2019 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donadigo/787e9fa3689bcaf8a91eed3a71bad228 to your computer and use it in GitHub Desktop.
Save donadigo/787e9fa3689bcaf8a91eed3a71bad228 to your computer and use it in GitHub Desktop.
From 33a3888a76cd12ef59bbd3097f9f32343b928367 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adam=20Bie=C5=84kowski?= <donadigos159@gmail.com>
Date: Tue, 30 Apr 2019 17:36:54 +0200
Subject: [PATCH] lib: add BadgeColor setting to override the urgent color
diff --git a/lib/DockRenderer.vala b/lib/DockRenderer.vala
index de795f7..5f9fcd2 100644
--- a/lib/DockRenderer.vala
+++ b/lib/DockRenderer.vala
@@ -867,9 +867,12 @@ namespace Plank
var surface = new Surface.with_surface (width, height, model);
var icon_size = int.min (width, height);
- var urgent_color = get_styled_color ();
- urgent_color.add_hue (theme.UrgentHueShift);
-
+ var urgent_color = theme.BadgeColor;
+ if (urgent_color.equal ({0.0, 0.0, 0.0, 0.0})) {
+ urgent_color = get_styled_color ();
+ urgent_color.add_hue (theme.UrgentHueShift);
+ }
+
// draw item's count
if (item.CountVisible)
theme.draw_item_count (surface, icon_size, urgent_color, item.Count);
diff --git a/lib/Drawing/DockTheme.vala b/lib/Drawing/DockTheme.vala
index 47fce13..11cd696 100644
--- a/lib/Drawing/DockTheme.vala
+++ b/lib/Drawing/DockTheme.vala
@@ -43,6 +43,9 @@ namespace Plank
[Description(nick = "indicator-size", blurb = "The size of item indicators, in tenths of a percent of IconSize.")]
public double IndicatorSize { get; set; }
+ [Description(nick = "badge-color", blurb = "The color (RGBA) of the badge displaying urgent count")]
+ public Color BadgeColor { get; set; }
+
[Description(nick = "icon-shadow-size", blurb = "The size of the icon-shadow behind every item, in tenths of a percent of IconSize.")]
public double IconShadowSize { get; set; }
@@ -117,6 +120,7 @@ namespace Plank
LaunchBounceHeight = 0.625;
FadeOpacity = 1.0;
ClickTime = 300;
+ BadgeColor = { 0.0, 0.0, 0.0, 0.0 };
UrgentBounceTime = 600;
LaunchBounceTime = 600;
ActiveTime = 300;
@@ -641,6 +645,9 @@ namespace Plank
else if (UrgentHueShift > 180)
UrgentHueShift = 180;
break;
+
+ case "BadgeColor":
+ break;
}
}
}
--
2.17.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment