libyui-qt
2.49.2
|
Public Member Functions | |
bool | styleSheetExists (const QString &file) |
Determines if an style sheet exists. More... | |
bool | loadStyleSheet (const QString &file) |
Loads and apply a style sheet from a file. More... | |
void | setStyleSheet (const QString &text) |
Applies a style sheet from a string. More... | |
bool | loadDefaultStyleSheet () |
Loads the default stylesheet. More... | |
bool | loadAlternateStyleSheet () |
Loads the alternate stylesheet. More... | |
QString | themeDir () const |
Returns the path to the style sheets directory. | |
void | registerWidget (QWidget *widget) |
Registers a widget and applies the style sheet. More... | |
void | unregisterWidget (QWidget *widget) |
Unregisters a widget. More... | |
void | registerChildWidget (QWidget *parent, QWidget *widget) |
Registers a child widget. More... | |
QString | textStyle () const |
void | setDefaultStyleSheet (const QString &styleSheet) |
Set style sheet for the default theme. More... | |
void | setAlternateStyleSheet (const QString &styleSheet) |
Set style sheet for the alternate theme. More... | |
void | toggleAlternateStyleSheet () |
Toggle between default/alternate style sheets. | |
bool | usingAlternateStyleSheet () |
Determines if the alternate style is being used. | |
bool | updateRendering (QWidget *wid) |
Static Public Member Functions | |
static QY2Styler * | styler () |
Protected Member Functions | |
QY2Styler (QObject *parent, const QString &defaultStyleSheet="", const QString &alternateStyleSheet="") | |
Constructor. More... | |
void | renderParent (QWidget *wid) |
QImage | getScaled (const QString name, const QSize &size) |
void | processUrls (QString &text) |
Search and replace some self-defined macros in the style sheet. More... | |
const QString | buildStyleSheet (QString content) |
Build a stylesheet from a string. | |
const QString | buildStyleSheet (QString content, QStringList &alreadyImportedFilenames) |
Build a stylesheet from a string. More... | |
const QString | buildStyleSheetFromFile (const QString &filename, QStringList &alreadyImportedFilenames) |
Build a stylesheet from a file. More... | |
bool | eventFilter (QObject *obj, QEvent *ev) |
Protected Attributes | |
QString | _currentStyleSheet |
QString | _defaultStyleSheet = DEFAULT_STYLE_SHEET |
QString | _alternateStyleSheet = HIGH_CONTRAST_STYLE_SHEET |
bool | _usingAlternateStyleSheet = false |
Definition at line 38 of file QY2Styler.h.
|
protected |
Constructor.
Use the static styler() function instead to return the singleton for this class.
Definition at line 55 of file QY2Styler.cc.
|
protected |
Build a stylesheet from a string.
Receives a list of already imported files.
Definition at line 152 of file QY2Styler.cc.
|
protected |
Build a stylesheet from a file.
Receives a list of already imported files.
Definition at line 165 of file QY2Styler.cc.
bool QY2Styler::loadAlternateStyleSheet | ( | ) |
Loads the alternate stylesheet.
The alternate stylesheet is determined by the environment variable Y2ALTSTYLE. If this variable is not set, the HIGH_COLOR_STYLE_SHEET style sheet will be used.
Definition at line 120 of file QY2Styler.cc.
bool QY2Styler::loadDefaultStyleSheet | ( | ) |
Loads the default stylesheet.
The default stylesheet is determined by the environment variable Y2STYLE. If this variable is not set, the DEFAULT_STYLE_SHEET style sheet will be used.
Definition at line 113 of file QY2Styler.cc.
bool QY2Styler::loadStyleSheet | ( | const QString & | file | ) |
Loads and apply a style sheet from a file.
file | Filename. It should live in the themeDir() directory. |
Definition at line 127 of file QY2Styler.cc.
|
protected |
Search and replace some self-defined macros in the style sheet.
Among other things, expands the file name inside url( filename.png ) in the style sheet with the full path.
Definition at line 201 of file QY2Styler.cc.
void QY2Styler::registerChildWidget | ( | QWidget * | parent, |
QWidget * | widget | ||
) |
Registers a child widget.
parent | Parent widget. |
widget | Widget to register. |
Definition at line 284 of file QY2Styler.cc.
void QY2Styler::registerWidget | ( | QWidget * | widget | ) |
Registers a widget and applies the style sheet.
widget | Widget to register. |
Definition at line 268 of file QY2Styler.cc.
void QY2Styler::setAlternateStyleSheet | ( | const QString & | styleSheet | ) |
Set style sheet for the alternate theme.
If the style sheet does not exists, it won't be changed.
styleSheet | Style sheet file name |
Definition at line 105 of file QY2Styler.cc.
void QY2Styler::setDefaultStyleSheet | ( | const QString & | styleSheet | ) |
Set style sheet for the default theme.
If the style sheet does not exists, it won't be changed.
styleSheet | Style sheet file name |
Definition at line 97 of file QY2Styler.cc.
void QY2Styler::setStyleSheet | ( | const QString & | text | ) |
Applies a style sheet from a string.
text | Style sheet content. |
Definition at line 177 of file QY2Styler.cc.
bool QY2Styler::styleSheetExists | ( | const QString & | file | ) |
Determines if an style sheet exists.
file | Filename. It should live in the themeDir() directory. |
Definition at line 91 of file QY2Styler.cc.
void QY2Styler::unregisterWidget | ( | QWidget * | widget | ) |
Unregisters a widget.
widget | Widget to unregister. |
Definition at line 277 of file QY2Styler.cc.