mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
fix configuration dialog error
even if user selects Cancel in font dialog html codes pasted
This commit is contained in:
parent
139554578c
commit
f8e9945bc4
2
sources/3rdparty/fontdialog
vendored
2
sources/3rdparty/fontdialog
vendored
@ -1 +1 @@
|
|||||||
Subproject commit ef47b1146e88caaa9be4f68d5b42919f36ab051c
|
Subproject commit e7bcf8ee858e7be3012168e12c7b14ccc28535b4
|
@ -73,6 +73,11 @@ Item {
|
|||||||
"size": plasmoid.configuration.fontSize
|
"size": plasmoid.configuration.fontSize
|
||||||
}
|
}
|
||||||
var font = awActions.getFont(defaultFont)
|
var font = awActions.getFont(defaultFont)
|
||||||
|
if (font.applied != 1) {
|
||||||
|
if (debug) console.debug("No font selected")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var selected = textPattern.selectedText
|
var selected = textPattern.selectedText
|
||||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||||
textPattern.insert(textPattern.cursorPosition,
|
textPattern.insert(textPattern.cursorPosition,
|
||||||
|
@ -154,11 +154,14 @@ QVariantMap AWActions::getFont(const QVariantMap defaultFont) const
|
|||||||
qCDebug(LOG_AW) << "Default font is" << defaultFont;
|
qCDebug(LOG_AW) << "Default font is" << defaultFont;
|
||||||
|
|
||||||
QVariantMap fontMap;
|
QVariantMap fontMap;
|
||||||
|
int ret = 0;
|
||||||
CFont defaultCFont = CFont(defaultFont[QString("family")].toString(),
|
CFont defaultCFont = CFont(defaultFont[QString("family")].toString(),
|
||||||
defaultFont[QString("size")].toInt(), 400, false,
|
defaultFont[QString("size")].toInt(), 400, false,
|
||||||
defaultFont[QString("color")].toString());
|
defaultFont[QString("color")].toString());
|
||||||
CFont font
|
CFont font = CFontDialog::getFont(i18n("Select font"), defaultCFont, false,
|
||||||
= CFontDialog::getFont(i18n("Select font"), defaultCFont, false, false);
|
false, &ret);
|
||||||
|
|
||||||
|
fontMap[QString("applied")] = ret;
|
||||||
fontMap[QString("color")] = font.color().name();
|
fontMap[QString("color")] = font.color().name();
|
||||||
fontMap[QString("family")] = font.family();
|
fontMap[QString("family")] = font.family();
|
||||||
fontMap[QString("size")] = font.pointSize();
|
fontMap[QString("size")] = font.pointSize();
|
||||||
|
Loading…
Reference in New Issue
Block a user