Merge branch 'develop' into office-filetypes
This commit is contained in:
commit
ef6ad7f538
|
@ -66,10 +66,8 @@ def InitialiseDefaults():
|
||||||
|
|
||||||
|
|
||||||
global ORIGINAL_STYLE_NAME
|
global ORIGINAL_STYLE_NAME
|
||||||
global CURRENT_STYLE_NAME
|
|
||||||
|
|
||||||
ORIGINAL_STYLE_NAME = QW.QApplication.instance().style().objectName()
|
ORIGINAL_STYLE_NAME = QW.QApplication.instance().style().name()
|
||||||
CURRENT_STYLE_NAME = ORIGINAL_STYLE_NAME
|
|
||||||
|
|
||||||
global ORIGINAL_STYLESHEET
|
global ORIGINAL_STYLESHEET
|
||||||
global CURRENT_STYLESHEET
|
global CURRENT_STYLESHEET
|
||||||
|
@ -77,31 +75,28 @@ def InitialiseDefaults():
|
||||||
ORIGINAL_STYLESHEET = QW.QApplication.instance().styleSheet()
|
ORIGINAL_STYLESHEET = QW.QApplication.instance().styleSheet()
|
||||||
CURRENT_STYLESHEET = ORIGINAL_STYLESHEET
|
CURRENT_STYLESHEET = ORIGINAL_STYLESHEET
|
||||||
|
|
||||||
def SetStyleFromName( name ):
|
def SetStyleFromName( name: str ):
|
||||||
|
|
||||||
global CURRENT_STYLE_NAME
|
current_style_name = QW.QApplication.instance().style().name()
|
||||||
|
|
||||||
if name == CURRENT_STYLE_NAME:
|
if name.casefold() == current_style_name.casefold():
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
if name in GetAvailableStyles():
|
try:
|
||||||
|
|
||||||
try:
|
new_style = QW.QApplication.instance().setStyle( name )
|
||||||
|
|
||||||
|
if new_style is None:
|
||||||
|
|
||||||
QW.QApplication.instance().setStyle( name )
|
raise HydrusExceptions.DataMissing( 'Style "{}" does not exist! If this is the default, perhaps a third-party custom style, you may have to restart the client to re-set it.'.format( name ) )
|
||||||
|
|
||||||
CURRENT_STYLE_NAME = name
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
|
|
||||||
raise HydrusExceptions.DataMissing( 'Style "{}" could not be generated/applied. If this is the default, perhaps a third-party custom style, you may have to restart the client to re-set it. Extra error info: {}'.format( name, e ) )
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
except Exception as e:
|
||||||
|
|
||||||
raise HydrusExceptions.DataMissing( 'Style "{}" does not exist! If this is the default, perhaps a third-party custom style, you may have to restart the client to re-set it.'.format( name ) )
|
raise HydrusExceptions.DataMissing( 'Style "{}" could not be generated/applied. If this is the default, perhaps a third-party custom style, you may have to restart the client to re-set it. Extra error info: {}'.format( name, e ) )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def SetStyleSheet( stylesheet, prepend_hydrus = True ):
|
def SetStyleSheet( stylesheet, prepend_hydrus = True ):
|
||||||
|
|
|
@ -45,6 +45,10 @@ def GetCoverPagePath( zip_handle: zipfile.ZipFile ):
|
||||||
|
|
||||||
for path in all_file_paths:
|
for path in all_file_paths:
|
||||||
|
|
||||||
|
if path.startswith('__MACOSX/'):
|
||||||
|
|
||||||
|
continue
|
||||||
|
|
||||||
if '.' in path:
|
if '.' in path:
|
||||||
|
|
||||||
ext_with_dot = '.' + path.split( '.' )[-1]
|
ext_with_dot = '.' + path.split( '.' )[-1]
|
||||||
|
@ -161,6 +165,10 @@ def ZipLooksLikeCBZ( path_to_zip ):
|
||||||
|
|
||||||
filename = zip_info.filename
|
filename = zip_info.filename
|
||||||
|
|
||||||
|
if filename.startswith('__MACOSX/'):
|
||||||
|
|
||||||
|
continue
|
||||||
|
|
||||||
if '/' in filename:
|
if '/' in filename:
|
||||||
|
|
||||||
directory_path = '/'.join( filename.split( '/' )[:-1] )
|
directory_path = '/'.join( filename.split( '/' )[:-1] )
|
||||||
|
|
|
@ -481,7 +481,7 @@ def GetFileInfo( path, mime = None, ok_to_look_for_hydrus_updates = False ):
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
|
||||||
( width, height ) = ( 100, 100 )
|
( width, height ) = ( None, None )
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
|
||||||
|
|
|
@ -17,20 +17,11 @@ QLabel#HydrusValid
|
||||||
color: #008000;
|
color: #008000;
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit#HydrusValid
|
QLineEdit#HydrusValid, QTextEdit#HydrusValid, QPlainTextEdit#HydrusValid
|
||||||
{
|
{
|
||||||
background-color: #80ff80;
|
background-color: #80ff80;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextEdit#HydrusValid
|
|
||||||
{
|
|
||||||
background-color: #80ff80;
|
|
||||||
}
|
|
||||||
|
|
||||||
QPlainTextEdit#HydrusValid
|
|
||||||
{
|
|
||||||
background-color: #80ff80;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Duplicates 'middle' text colour */
|
/* Duplicates 'middle' text colour */
|
||||||
|
|
||||||
|
@ -39,20 +30,11 @@ QLabel#HydrusIndeterminate
|
||||||
color: #000080;
|
color: #000080;
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit#HydrusIndeterminate
|
QLineEdit#HydrusIndeterminate, QTextEdit#HydrusIndeterminate, QPlainTextEdit#HydrusIndeterminate
|
||||||
{
|
{
|
||||||
background-color: #000080;
|
background-color: #000080;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextEdit#HydrusIndeterminate
|
|
||||||
{
|
|
||||||
background-color: #000080;
|
|
||||||
}
|
|
||||||
|
|
||||||
QPlainTextEdit#HydrusIndeterminate
|
|
||||||
{
|
|
||||||
background-color: #000080;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Example: This regex is invalid */
|
/* Example: This regex is invalid */
|
||||||
|
|
||||||
|
@ -61,29 +43,15 @@ QLabel#HydrusInvalid
|
||||||
color: #800000;
|
color: #800000;
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit#HydrusInvalid
|
QLineEdit#HydrusInvalid, QTextEdit#HydrusInvalid, QPlainTextEdit#HydrusInvalid
|
||||||
{
|
{
|
||||||
background-color: #ff8080;
|
background-color: #ff8080;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextEdit#HydrusInvalid
|
|
||||||
{
|
|
||||||
background-color: #ff8080;
|
|
||||||
}
|
|
||||||
|
|
||||||
QPlainTextEdit#HydrusInvalid
|
|
||||||
{
|
|
||||||
background-color: #ff8080;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Example: Your files are going to be deleted! */
|
/* Example: Your files are going to be deleted! */
|
||||||
|
|
||||||
QLabel#HydrusWarning
|
QLabel#HydrusWarning, QCheckBox#HydrusWarning
|
||||||
{
|
|
||||||
color: #800000;
|
|
||||||
}
|
|
||||||
|
|
||||||
QCheckBox#HydrusWarning
|
|
||||||
{
|
{
|
||||||
color: #800000;
|
color: #800000;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,141 @@
|
||||||
|
/*
|
||||||
|
Default QSS for hydrus. This is prepended to any stylesheet loaded in hydrus.
|
||||||
|
Copying these entries in your own stylesheets should override these settings.
|
||||||
|
This will get more work in future.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Here are some text and background colours
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Example: This regex is valid */
|
||||||
|
|
||||||
|
QLabel#HydrusValid
|
||||||
|
{
|
||||||
|
color: #2ed42e;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit#HydrusValid, QTextEdit#HydrusValid, QPlainTextEdit#HydrusValid
|
||||||
|
{
|
||||||
|
background-color: #80ff80;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Duplicates 'middle' text colour */
|
||||||
|
|
||||||
|
QLabel#HydrusIndeterminate
|
||||||
|
{
|
||||||
|
color: #8080ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit#HydrusIndeterminate, QTextEdit#HydrusIndeterminate, QPlainTextEdit#HydrusIndeterminate
|
||||||
|
{
|
||||||
|
background-color: #8080ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Example: This regex is invalid */
|
||||||
|
|
||||||
|
QLabel#HydrusInvalid
|
||||||
|
{
|
||||||
|
color: #ff7171;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit#HydrusInvalid, QTextEdit#HydrusInvalid, QPlainTextEdit#HydrusInvalid
|
||||||
|
{
|
||||||
|
background-color: #ff8080;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Example: Your files are going to be deleted! */
|
||||||
|
|
||||||
|
QLabel#HydrusWarning, QCheckBox#HydrusWarning
|
||||||
|
{
|
||||||
|
color: #ff7171;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Buttons on dialogs
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
QPushButton#HydrusAccept
|
||||||
|
{
|
||||||
|
color: #2ed42e;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#HydrusCancel
|
||||||
|
{
|
||||||
|
color: #ff7171;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
This is the green/red button that switches 'include current tags' and similar states on/off
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
QPushButton#HydrusOnOffButton[hydrus_on=true]
|
||||||
|
{
|
||||||
|
color: #2ed42e;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#HydrusOnOffButton[hydrus_on=false]
|
||||||
|
{
|
||||||
|
color: #ff7171;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
This is the Command Palette (default Ctrl+P), and specifically the background colour of the item you currently have selected.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
QLocatorResultWidget#selectedLocatorResult
|
||||||
|
{
|
||||||
|
background-color: palette(highlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
QLocatorResultWidget QWidget
|
||||||
|
{
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Custom Controls
|
||||||
|
|
||||||
|
These are drawn by hydev on a blank canvas, so they work a little different.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
The scanbar beneath video/audio in the media viewer.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
QWidget#HydrusAnimationBar
|
||||||
|
{
|
||||||
|
qproperty-hab_border: #000000;
|
||||||
|
qproperty-hab_background: #606060;
|
||||||
|
qproperty-hab_nub: #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
And this one is odd since we are assigning a colour to <a> html richtext inside a QLabel.
|
||||||
|
We hack it with hardcoded 'style' attribute in the html in python code.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
QLabel#HydrusHyperlink
|
||||||
|
{
|
||||||
|
qproperty-link_color: palette(link);
|
||||||
|
}
|
Loading…
Reference in New Issue