From c772bf5583dec23513371392ca6d2018518483cb Mon Sep 17 00:00:00 2001 From: Maximilian Siess Date: Tue, 18 Apr 2017 13:35:29 +0200 Subject: Added text alignment option --- core.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core.py') diff --git a/core.py b/core.py index 895d1a9..6bd533d 100644 --- a/core.py +++ b/core.py @@ -26,7 +26,7 @@ class Core(): except: return "avconv" - def drawBaseImage(self, backgroundImage, titleText, titleFont): + def drawBaseImage(self, backgroundImage, titleText, titleFont, alignment): if self._image == None or not self.lastBackgroundImage == backgroundImage: self.lastBackgroundImage = backgroundImage @@ -49,7 +49,13 @@ class Core(): painter.setFont(font) painter.setPen(QColor(255, 255, 255)) - painter.drawText(70, 375, titleText) + fm = QtGui.QFontMetrics(font) + if alignment == "Left": + painter.drawText(70, 375, titleText) + if alignment == "Middle": + painter.drawText(1280/2 - fm.width(titleText)/2, 375, titleText) + if alignment == "Right": + painter.drawText(1210 - fm.width(titleText), 375, titleText) painter.end() buffer = QtCore.QBuffer() -- cgit v1.2.3
🚨 these dotfiles are HEAVILY tailored for my needs and setup. Feel free to explore and find ideas, but use at your own risk.
aboutsummaryrefslogtreecommitdiffstats
path: root/xfce4 (unfollow)
Commit message (Expand)AuthorFilesLines
2022-01-27stronger luminosity on the active window borderBlista Kanjo2-2/+2
2022-01-27declared "adwaita" as current themeBlista Kanjo1-1/+1
2022-01-27modified adwaita theme to vide standardsBlista Kanjo2-7/+8
2022-01-25removed wine-preloader and references to /home/kylertBlista Kanjo1-3/+2
2022-01-25added wineserver autostartBlista Kanjo1-0/+2
2022-01-20added "Gnome-system-monitor" to floating clientsBlista Kanjo1-0/+1
2022-01-18enabled sloppy focus, so that focus follows mouse cursorBlista Kanjo1-2/+2
2022-01-13[Revision 9] made emojis more searchableBlista Kanjo1-3/+3
2022-01-10updated to unicode 14Blista Kanjo1-0/+87
2022-01-10replaced some keybindsBlista Kanjo1-2/+2
2022-01-10[Revision 8] made emojis more searchableBlista Kanjo1-1/+1
2022-01-08added external subtitle support to mpvBlista Kanjo1-0/+1