|
34 | 34 | import sys |
35 | 35 | import logging |
36 | 36 |
|
| 37 | + |
37 | 38 | logger = logging.getLogger(__name__) |
38 | 39 |
|
39 | 40 | from PyQt4 import QtGui, uic |
@@ -97,7 +98,41 @@ class MainUI(QtGui.QMainWindow, main_window_class): |
97 | 98 | def __init__(self, *args): |
98 | 99 | super(MainUI, self).__init__(*args) |
99 | 100 | 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 | + |
101 | 136 | self.cf = Crazyflie(ro_cache=sys.path[0] + "/cflib/cache", |
102 | 137 | rw_cache=sys.path[1] + "/cache") |
103 | 138 |
|
|
0 commit comments