summaryrefslogtreecommitdiff
path: root/raphodo/primarybutton.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-02 06:51:13 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-02 06:51:13 +0200
commitc5fc6c6030d7d9d1b2af3d5165bebed3decd741b (patch)
treedfacccc9ae0747e53e53e5388b2ecd0623e040c3 /raphodo/primarybutton.py
parent77dd64c0757c0191b276e65c24ee9874959790c8 (diff)
New upstream version 0.9.4upstream/0.9.4
Diffstat (limited to 'raphodo/primarybutton.py')
-rw-r--r--raphodo/primarybutton.py74
1 files changed, 37 insertions, 37 deletions
diff --git a/raphodo/primarybutton.py b/raphodo/primarybutton.py
index af64b6c..814578f 100644
--- a/raphodo/primarybutton.py
+++ b/raphodo/primarybutton.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 Damon Lynch <damonlynch@gmail.com>
+# Copyright (C) 2016-2017 Damon Lynch <damonlynch@gmail.com>
# This file is part of Rapid Photo Downloader.
#
@@ -17,7 +17,7 @@
# see <http://www.gnu.org/licenses/>.
__author__ = 'Damon Lynch'
-__copyright__ = "Copyright 2016, Damon Lynch"
+__copyright__ = "Copyright 2016-2017, Damon Lynch"
import math
@@ -67,10 +67,9 @@ class DownloadButton(QPushButton):
super().__init__(text, parent)
self.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
- # self.setFlat(True)
- font_height = QFontMetrics(self.font()).tightBoundingRect(_('Download 8 Photos and 10 '
- 'Videos')).height()
+ font_height = QFontMetrics(self.font()).tightBoundingRect(
+ _('Download 8 Photos and 10 Videos')).height()
padding = math.ceil(font_height * 1.7)
height = font_height // 2 * 6
radius = height // 2
@@ -86,39 +85,40 @@ class DownloadButton(QPushButton):
disabledBorderColor = disabledColor.darker(105)
disabledTextColor = palette.highlightedText().color()
-
# outline:none is used to remove the rectangle that appears on a
# button when the button has focus
# http://stackoverflow.com/questions/17280056/qt-css-decoration-on-focus
self.setStyleSheet("""
- QPushButton {
- background-color: %(color)s;
- outline: none;
- padding-left: %(padding)dpx;
- padding-right: %(padding)dpx;
- border-radius: %(radius)dpx;
- border: 1px solid %(borderColor)s;
- height: %(height)dpx;
- color: %(textcolor)s;
- }
- QPushButton:hover {
- background-color: %(hoverColor)s;
- border: 1px solid %(hoverBorderColor)s;
- }
- QPushButton:disabled {
- background-color: %(disabledColor)s;
- color: %(disabledTextColor)s;
- border: 1px solid %(disabledBorderColor)s;
- }
- """ % dict(color=primaryColor.name(),
- padding=padding,
- borderColor=borderColor.name(),
- hoverColor=hoverColor.name(),
- hoverBorderColor=hoverBorderColor.name(),
- height=height,
- radius=radius,
- textcolor=primaryTextColor.name(),
- disabledColor=disabledColor.name(),
- disabledTextColor=disabledTextColor.name(),
- disabledBorderColor=disabledBorderColor.name()
- ))
+ QPushButton {
+ background-color: %(color)s;
+ outline: none;
+ padding-left: %(padding)dpx;
+ padding-right: %(padding)dpx;
+ border-radius: %(radius)dpx;
+ border: 1px solid %(borderColor)s;
+ height: %(height)dpx;
+ color: %(textcolor)s;
+ }
+ QPushButton:hover {
+ background-color: %(hoverColor)s;
+ border: 1px solid %(hoverBorderColor)s;
+ }
+ QPushButton:disabled {
+ background-color: %(disabledColor)s;
+ color: %(disabledTextColor)s;
+ border: 1px solid %(disabledBorderColor)s;
+ }
+ """ % dict(
+ color=primaryColor.name(),
+ padding=padding,
+ borderColor=borderColor.name(),
+ hoverColor=hoverColor.name(),
+ hoverBorderColor=hoverBorderColor.name(),
+ height=height,
+ radius=radius,
+ textcolor=primaryTextColor.name(),
+ disabledColor=disabledColor.name(),
+ disabledTextColor=disabledTextColor.name(),
+ disabledBorderColor=disabledBorderColor.name()
+ )
+ )