From 1fab55172651541a524cd333197054ea3db177f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Axel=20D=C3=B6rfler?= <axeld@pinc-software.de>
Date: Sat, 3 Nov 2018 19:58:19 +0000
Subject: [PATCH] Deskbar: Center window icons in WindowMenuItem

* They had a fixed top offset which looked bad with larger font sizes.
* The icons should be replaced with vector icons, though, and properly
  resized.
---
 src/apps/deskbar/WindowMenuItem.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/apps/deskbar/WindowMenuItem.cpp b/src/apps/deskbar/WindowMenuItem.cpp
index f9d70bfbdc..f7a5aeb4c3 100644
--- a/src/apps/deskbar/WindowMenuItem.cpp
+++ b/src/apps/deskbar/WindowMenuItem.cpp
@@ -157,7 +157,7 @@ void
 TWindowMenuItem::DrawContent()
 {
 	BMenu* menu = Menu();
-	BPoint contentLocation = ContentLocation() + BPoint(kHPad, kVPad);
+	BPoint contentLocation = ContentLocation() + BPoint(kHPad, 0);
 
 	if (fID >= 0) {
 		menu->SetDrawingMode(B_OP_OVER);
@@ -166,6 +166,10 @@ TWindowMenuItem::DrawContent()
 		if (width > 16)
 			contentLocation.x -= 8;
 
+		float height;
+		GetContentSize(NULL, &height);
+		contentLocation.y += (height - fBitmap->Bounds().Height()) / 2;
+
 		menu->MovePenTo(contentLocation);
 		menu->DrawBitmapAsync(fBitmap);
 
@@ -174,7 +178,7 @@ TWindowMenuItem::DrawContent()
 
 		contentLocation.x += kIconRect.Width() + kLabelOffset;
 	}
-	contentLocation.y += fLabelAscent;
+	contentLocation.y = ContentLocation().y + kVPad + fLabelAscent;
 
 	menu->SetDrawingMode(B_OP_COPY);
 	menu->MovePenTo(contentLocation);