mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
Avoid crash in +/- font size by setting style sheet to ""
This commit is contained in:
@@ -78,22 +78,21 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CFontMenu::fontSizePlus()
|
void CFontMenu::fontSizePlus()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_widget, Q_FUNC_INFO, "No widget");
|
if (!m_widget) { return; }
|
||||||
const int pt = m_widget->font().pointSize() + 1;
|
const int pt = m_widget->font().pointSize() + 1;
|
||||||
if (pt > 24) { return; }
|
if (pt > 24) { return; }
|
||||||
m_widget->setStyleSheet(
|
|
||||||
CStyleSheetUtility::asStylesheet(m_widget, pt)
|
m_widget->setStyleSheet(""); // avoid Qt crash
|
||||||
);
|
m_widget->setStyleSheet(CStyleSheetUtility::asStylesheet(m_widget, pt));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFontMenu::fontSizeMinus()
|
void CFontMenu::fontSizeMinus()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_widget, Q_FUNC_INFO, "No widget");
|
if (!m_widget) { return; }
|
||||||
const int pt = m_widget->font().pointSize() - 1;
|
const int pt = m_widget->font().pointSize() - 1;
|
||||||
if (pt < 5) { return; }
|
if (pt < 5) { return; }
|
||||||
m_widget->setStyleSheet(
|
m_widget->setStyleSheet(""); // avoid Qt crash
|
||||||
CStyleSheetUtility::asStylesheet(m_widget, pt)
|
m_widget->setStyleSheet(CStyleSheetUtility::asStylesheet(m_widget, pt));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFontMenu::fontReset()
|
void CFontMenu::fontReset()
|
||||||
|
|||||||
Reference in New Issue
Block a user