parent
925bb4eea3
commit
cba895e723
|
@ -44,6 +44,7 @@ public:
|
||||||
|
|
||||||
void checkLayoutChange();
|
void checkLayoutChange();
|
||||||
void resetLayout();
|
void resetLayout();
|
||||||
|
void updateNotifier();
|
||||||
|
|
||||||
void keyEvent(KeyEvent *event) override;
|
void keyEvent(KeyEvent *event) override;
|
||||||
|
|
||||||
|
@ -61,7 +62,6 @@ private:
|
||||||
void switchToNextLayout();
|
void switchToNextLayout();
|
||||||
void switchToPreviousLayout();
|
void switchToPreviousLayout();
|
||||||
void switchToLayout(xkb_layout_index_t index);
|
void switchToLayout(xkb_layout_index_t index);
|
||||||
void updateNotifier();
|
|
||||||
void reinitNotifierMenu();
|
void reinitNotifierMenu();
|
||||||
void loadShortcuts();
|
void loadShortcuts();
|
||||||
Xkb *m_xkb;
|
Xkb *m_xkb;
|
||||||
|
|
|
@ -34,7 +34,11 @@ Policy::~Policy() = default;
|
||||||
|
|
||||||
void Policy::setLayout(quint32 layout)
|
void Policy::setLayout(quint32 layout)
|
||||||
{
|
{
|
||||||
|
const quint32 previousLayout = m_xkb->currentLayout();
|
||||||
m_xkb->switchToLayout(layout);
|
m_xkb->switchToLayout(layout);
|
||||||
|
if (previousLayout != m_xkb->currentLayout()) {
|
||||||
|
m_layout->updateNotifier();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 Policy::layout() const
|
quint32 Policy::layout() const
|
||||||
|
@ -92,7 +96,7 @@ GlobalPolicy::GlobalPolicy(Xkb *xkb, KeyboardLayout *_layout, const KConfigGroup
|
||||||
[this, xkb] (const QString &name) {
|
[this, xkb] (const QString &name) {
|
||||||
Q_UNUSED(name)
|
Q_UNUSED(name)
|
||||||
if (xkb->numberOfLayouts() > 1) {
|
if (xkb->numberOfLayouts() > 1) {
|
||||||
xkb->switchToLayout(m_config.readEntry(defaultLayoutEntryKey(), 0));
|
setLayout(m_config.readEntry(defaultLayoutEntryKey(), 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue