Correctly set i18n suffix in mousemark spinbox.
Summary: QSpinBox can't handle plural suffixes. Something previously done by KIntSpinBox. Using setSuffix(ki18np("pixel", "pixels")).toString() does nothing, as at the time of conversion we don't know which one to use. This patch uses KPluralHandlingSpinBox and correct ki18np. Note, "new" dependency was already linked implicitly in other kwin, but we need to add it for this KCM. Test Plan: Opened KCM (in English) set counter to 1 pixel and 2 pixels. No longer had a big warning. Also appropriate number of s's appeared. Reviewers: #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3222
This commit is contained in:
parent
3a179f32af
commit
254690e899
4 changed files with 44 additions and 47 deletions
|
@ -86,6 +86,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
||||||
Declarative
|
Declarative
|
||||||
KCMUtils
|
KCMUtils
|
||||||
KIO
|
KIO
|
||||||
|
TextWidgets
|
||||||
NewStuff
|
NewStuff
|
||||||
Service
|
Service
|
||||||
XmlGui
|
XmlGui
|
||||||
|
|
|
@ -12,6 +12,7 @@ target_link_libraries(kwin_mousemark_config
|
||||||
KF5::GlobalAccel
|
KF5::GlobalAccel
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::Service
|
KF5::Service
|
||||||
|
KF5::TextWidgets
|
||||||
KF5::XmlGui
|
KF5::XmlGui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList
|
||||||
{
|
{
|
||||||
m_ui = new MouseMarkEffectConfigForm(this);
|
m_ui = new MouseMarkEffectConfigForm(this);
|
||||||
|
|
||||||
m_ui->kcfg_LineWidth->setSuffix(ki18np(" pixel", " pixels").toString());
|
m_ui->kcfg_LineWidth->setSuffix(ki18np(" pixel", " pixels"));
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
<string>Appearance</string>
|
<string>Appearance</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Width:</string>
|
<string>Wid&th:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
@ -30,26 +30,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="2" column="0">
|
||||||
<widget class="QSpinBox" name="kcfg_LineWidth">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Color:</string>
|
<string>&Color:</string>
|
||||||
|
@ -62,7 +43,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="KColorCombo" name="kcfg_Color">
|
<widget class="KColorCombo" name="kcfg_Color">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
@ -72,15 +53,24 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="KPluralHandlingSpinBox" name="kcfg_LineWidth">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="KShortcutsEditor" name="editor" native="true">
|
<widget class="KShortcutsEditor" name="editor"/>
|
||||||
<property name="actionTypes">
|
|
||||||
<enum>KShortcutsEditor::GlobalAction</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
|
@ -106,9 +96,14 @@
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>KShortcutsEditor</class>
|
<class>KShortcutsEditor</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header location="global">KShortcutsEditor</header>
|
<header>kshortcutseditor.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>KPluralHandlingSpinBox</class>
|
||||||
|
<extends>QSpinBox</extends>
|
||||||
|
<header>kpluralhandlingspinbox.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
Loading…
Reference in a new issue