Skip to content

Commit c693480

Browse files
committed
Merge pull request #146 from lxrocks/master
Added css style to fix 'Skinny ProgressBar' in Yosemite
2 parents 95ea47a + 6793904 commit c693480

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

lib/cfclient/ui/main.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import sys
3535
import logging
3636

37+
3738
logger = logging.getLogger(__name__)
3839

3940
from PyQt4 import QtGui, uic
@@ -97,7 +98,41 @@ class MainUI(QtGui.QMainWindow, main_window_class):
9798
def __init__(self, *args):
9899
super(MainUI, self).__init__(*args)
99100
self.setupUi(self)
100-
101+
102+
######################################################
103+
### By lxrocks
104+
### 'Skinny Progress Bar' tweak for Yosemite
105+
### Tweak progress bar - artistic I am not - so pick your own colors !!!
106+
### Only apply to Yosemite
107+
######################################################
108+
import platform
109+
if platform.system() == 'Darwin':
110+
111+
(Version,junk,machine) = platform.mac_ver()
112+
logger.info("This is a MAC - checking if we can apply Progress Bar Stylesheet for Yosemite Skinny Bars ")
113+
yosemite = (10,10,0)
114+
tVersion = tuple(map(int, (Version.split("."))))
115+
116+
if tVersion >= yosemite:
117+
logger.info( "Found Yosemite:")
118+
119+
tcss = """
120+
QProgressBar {
121+
border: 2px solid grey;
122+
border-radius: 5px;
123+
text-align: center;
124+
}
125+
QProgressBar::chunk {
126+
background-color: #05B8CC;
127+
}
128+
"""
129+
self.setStyleSheet(tcss)
130+
131+
else:
132+
logger.info( "Pre-Yosemite")
133+
134+
######################################################
135+
101136
self.cf = Crazyflie(ro_cache=sys.path[0] + "/cflib/cache",
102137
rw_cache=sys.path[1] + "/cache")
103138

0 commit comments

Comments
 (0)