Skip to content

Commit

Permalink
Merge pull request #146 from lxrocks/master
Browse files Browse the repository at this point in the history
Added css style to fix 'Skinny ProgressBar' in Yosemite
  • Loading branch information
evoggy committed Jan 16, 2015
2 parents 95ea47a + 6793904 commit c693480
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion lib/cfclient/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import sys
import logging


logger = logging.getLogger(__name__)

from PyQt4 import QtGui, uic
Expand Down Expand Up @@ -97,7 +98,41 @@ class MainUI(QtGui.QMainWindow, main_window_class):
def __init__(self, *args):
super(MainUI, self).__init__(*args)
self.setupUi(self)


######################################################
### By lxrocks
### 'Skinny Progress Bar' tweak for Yosemite
### Tweak progress bar - artistic I am not - so pick your own colors !!!
### Only apply to Yosemite
######################################################
import platform
if platform.system() == 'Darwin':

(Version,junk,machine) = platform.mac_ver()
logger.info("This is a MAC - checking if we can apply Progress Bar Stylesheet for Yosemite Skinny Bars ")
yosemite = (10,10,0)
tVersion = tuple(map(int, (Version.split("."))))

if tVersion >= yosemite:
logger.info( "Found Yosemite:")

tcss = """
QProgressBar {
border: 2px solid grey;
border-radius: 5px;
text-align: center;
}
QProgressBar::chunk {
background-color: #05B8CC;
}
"""
self.setStyleSheet(tcss)

else:
logger.info( "Pre-Yosemite")

######################################################

self.cf = Crazyflie(ro_cache=sys.path[0] + "/cflib/cache",
rw_cache=sys.path[1] + "/cache")

Expand Down

0 comments on commit c693480

Please sign in to comment.