kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
Modif to the way css files get url when executing the app from a non compiled version.
Removed unneeded os importpull/35/head
rodzic
240152f465
commit
5ff7fdec95
|
@ -13,7 +13,6 @@
|
|||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
# import os
|
||||
import collections
|
||||
import logging
|
||||
import math
|
||||
|
|
|
@ -22,29 +22,35 @@ from .skins import Skins
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def DARK_SKIN_MONOCHROME():
|
||||
if debug == True:
|
||||
return join(dirname(abspath(__file__)), 'skins/dark-monochrome.css')
|
||||
else:
|
||||
if getattr(sys, 'frozen', False):
|
||||
return sys._MEIPASS + '/skins/dark-monochrome.css'
|
||||
else:
|
||||
return join(dirname(abspath(__file__)), 'skins/dark-monochrome.css')
|
||||
|
||||
|
||||
def DARK_SKIN_COLORED():
|
||||
if debug == True:
|
||||
return join(dirname(abspath(__file__)), 'skins/dark-colored.css')
|
||||
else:
|
||||
if getattr(sys, 'frozen', False):
|
||||
return sys._MEIPASS + '/skins/dark-colored.css'
|
||||
else:
|
||||
return join(dirname(abspath(__file__)), 'skins/dark-colored.css')
|
||||
|
||||
|
||||
def LIGHT_SKIN_MONOCHROME():
|
||||
if debug == True:
|
||||
return join(dirname(abspath(__file__)), 'skins/light-monochrome.css')
|
||||
else:
|
||||
if getattr(sys, 'frozen', False):
|
||||
return sys._MEIPASS + '/skins/light-monochrome.css'
|
||||
else:
|
||||
return join(dirname(abspath(__file__)), 'skins/light-monochrome.css')
|
||||
|
||||
|
||||
def LIGHT_SKIN_COLORED():
|
||||
if debug == True:
|
||||
return join(dirname(abspath(__file__)), 'skins/light-colored.css')
|
||||
else:
|
||||
|
||||
if getattr(sys, 'frozen', False):
|
||||
return sys._MEIPASS + '/skins/light-colored.css'
|
||||
else:
|
||||
return join(dirname(abspath(__file__)), 'skins/light-colored.css')
|
||||
|
||||
|
||||
DARK_SKIN_STRING_COLORED = "Dark Colored"
|
||||
DARK_SKIN_STRING_MONOCHROME = "Dark"
|
||||
|
@ -55,6 +61,7 @@ LIGHT_SKIN_STRING_MONOCHROME = "Light"
|
|||
class NanoVNA_UI:
|
||||
def getSkins():
|
||||
return [DARK_SKIN_STRING_COLORED, DARK_SKIN_STRING_MONOCHROME, LIGHT_SKIN_STRING_COLORED, LIGHT_SKIN_STRING_MONOCHROME]
|
||||
|
||||
def updateUI(self, skin, app):
|
||||
current_skin = self.skin_dropdown.currentText()
|
||||
logger.debug("Current Skin is: " + current_skin)
|
||||
|
@ -82,7 +89,7 @@ class NanoVNA_UI:
|
|||
logger.debug("Skin set to Default")
|
||||
|
||||
def validateSkin(saved_skin):
|
||||
if not saved_skin < DARK_SKIN_STRING_COLORED or not saved_skin < DARK_SKIN_STRING_MONOCHROME or not saved_skin < LIGHT_SKIN_STRING_COLORED or not saved_skin < LIGHT_SKIN_STRING_MONOCHROME:
|
||||
if saved_skin is DARK_SKIN_STRING_COLORED or saved_skin is DARK_SKIN_STRING_MONOCHROME or saved_skin is LIGHT_SKIN_STRING_COLORED or saved_skin is LIGHT_SKIN_STRING_MONOCHROME:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
|
Ładowanie…
Reference in New Issue