Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindecoration/kcm.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 83 | { | |||
---|---|---|---|---|---|
101 | layout->addWidget(widget); | 101 | layout->addWidget(widget); | ||
102 | 102 | | |||
103 | m_quickView->rootContext()->setContextProperty(QStringLiteral("decorationsModel"), m_proxyModel); | 103 | m_quickView->rootContext()->setContextProperty(QStringLiteral("decorationsModel"), m_proxyModel); | ||
104 | updateColors(); | 104 | updateColors(); | ||
105 | m_quickView->rootContext()->setContextProperty("_borderSizesIndex", 3); // 3 is normal | 105 | m_quickView->rootContext()->setContextProperty("_borderSizesIndex", 3); // 3 is normal | ||
106 | m_quickView->rootContext()->setContextProperty("leftButtons", m_leftButtons); | 106 | m_quickView->rootContext()->setContextProperty("leftButtons", m_leftButtons); | ||
107 | m_quickView->rootContext()->setContextProperty("rightButtons", m_rightButtons); | 107 | m_quickView->rootContext()->setContextProperty("rightButtons", m_rightButtons); | ||
108 | m_quickView->rootContext()->setContextProperty("availableButtons", m_availableButtons); | 108 | m_quickView->rootContext()->setContextProperty("availableButtons", m_availableButtons); | ||
109 | m_quickView->rootContext()->setContextProperty("initialThemeIndex", -1); | ||||
109 | 110 | | |||
110 | m_quickView->rootContext()->setContextProperty("titleFont", QFontDatabase::systemFont(QFontDatabase::TitleFont)); | 111 | m_quickView->rootContext()->setContextProperty("titleFont", QFontDatabase::systemFont(QFontDatabase::TitleFont)); | ||
111 | m_quickView->setResizeMode(QQuickView::SizeRootObjectToView); | 112 | m_quickView->setResizeMode(QQuickView::SizeRootObjectToView); | ||
112 | m_quickView->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/kcm_kwindecoration/main.qml")))); | 113 | m_quickView->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/kcm_kwindecoration/main.qml")))); | ||
113 | if (m_quickView->status() == QQuickView::Ready) { | 114 | if (m_quickView->status() == QQuickView::Ready) { | ||
114 | auto listView = m_quickView->rootObject()->findChild<QQuickItem*>("listView"); | 115 | auto listView = m_quickView->rootObject()->findChild<QQuickItem*>("listView"); | ||
115 | if (listView) { | 116 | if (listView) { | ||
116 | connect(listView, SIGNAL(currentIndexChanged()), this, SLOT(changed())); | 117 | connect(listView, SIGNAL(userChangedSelection()), this, SLOT(changed())); | ||
117 | } | 118 | } | ||
118 | } | 119 | } | ||
119 | 120 | | |||
120 | m_ui->tabWidget->tabBar()->disconnect(); | 121 | m_ui->tabWidget->tabBar()->disconnect(); | ||
121 | auto setCurrentTab = [this](int index) { | 122 | auto setCurrentTab = [this](int index) { | ||
122 | if (index == 0) | 123 | if (index == 0) | ||
123 | m_ui->doubleClickMessage->hide(); | 124 | m_ui->doubleClickMessage->hide(); | ||
124 | m_ui->filter->setVisible(index == 0); | 125 | m_ui->filter->setVisible(index == 0); | ||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Line(s) | 307 | { | |||
308 | const KConfigGroup config = KSharedConfig::openConfig("kwinrc")->group(s_pluginName); | 309 | const KConfigGroup config = KSharedConfig::openConfig("kwinrc")->group(s_pluginName); | ||
309 | const QString plugin = config.readEntry("library", s_defaultPlugin); | 310 | const QString plugin = config.readEntry("library", s_defaultPlugin); | ||
310 | const QString theme = config.readEntry("theme", s_defaultTheme); | 311 | const QString theme = config.readEntry("theme", s_defaultTheme); | ||
311 | m_ui->closeWindowsDoubleClick->setChecked(config.readEntry("CloseOnDoubleClickOnMenu", false)); | 312 | m_ui->closeWindowsDoubleClick->setChecked(config.readEntry("CloseOnDoubleClickOnMenu", false)); | ||
312 | const QVariant border = QVariant::fromValue(stringToSize(config.readEntry("BorderSize", s_borderSizeNormal))); | 313 | const QVariant border = QVariant::fromValue(stringToSize(config.readEntry("BorderSize", s_borderSizeNormal))); | ||
313 | m_ui->borderSizesCombo->setCurrentIndex(m_ui->borderSizesCombo->findData(border)); | 314 | m_ui->borderSizesCombo->setCurrentIndex(m_ui->borderSizesCombo->findData(border)); | ||
314 | 315 | | |||
315 | int themeIndex = m_proxyModel->mapFromSource(m_model->findDecoration(plugin, theme)).row(); | 316 | int themeIndex = m_proxyModel->mapFromSource(m_model->findDecoration(plugin, theme)).row(); | ||
316 | m_quickView->rootContext()->setContextProperty("savedIndex", themeIndex); | 317 | m_quickView->rootContext()->setContextProperty("initialThemeIndex", themeIndex); | ||
317 | 318 | | |||
318 | // buttons | 319 | // buttons | ||
319 | const auto &left = readDecorationButtons(config, "ButtonsOnLeft", QVector<KDecoration2::DecorationButtonType >{ | 320 | const auto &left = readDecorationButtons(config, "ButtonsOnLeft", QVector<KDecoration2::DecorationButtonType >{ | ||
320 | KDecoration2::DecorationButtonType::Menu, | 321 | KDecoration2::DecorationButtonType::Menu, | ||
321 | KDecoration2::DecorationButtonType::OnAllDesktops | 322 | KDecoration2::DecorationButtonType::OnAllDesktops | ||
322 | }); | 323 | }); | ||
323 | while (m_leftButtons->rowCount() > 0) { | 324 | while (m_leftButtons->rowCount() > 0) { | ||
324 | m_leftButtons->remove(0); | 325 | m_leftButtons->remove(0); | ||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |