Changeset View
Changeset View
Standalone View
Standalone View
src/kcmoduleqml.cpp
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 67 | { | |||
---|---|---|---|---|---|
127 | //around, so when we need to go outside and inside | 127 | //around, so when we need to go outside and inside | ||
128 | //pushPage/popPage are needed as push of StackView can't be directly invoked from c++ | 128 | //pushPage/popPage are needed as push of StackView can't be directly invoked from c++ | ||
129 | //because its parameters are QQmlV4Function which is not public | 129 | //because its parameters are QQmlV4Function which is not public | ||
130 | //the managers of onEnter/ReturnPressed are a workaround of | 130 | //the managers of onEnter/ReturnPressed are a workaround of | ||
131 | //Qt bug https://bugreports.qt.io/browse/QTBUG-70934 | 131 | //Qt bug https://bugreports.qt.io/browse/QTBUG-70934 | ||
132 | component->setData(QByteArrayLiteral("import QtQuick 2.3\n" | 132 | component->setData(QByteArrayLiteral("import QtQuick 2.3\n" | ||
133 | "import org.kde.kirigami 2.4 as Kirigami\n" | 133 | "import org.kde.kirigami 2.4 as Kirigami\n" | ||
134 | "Kirigami.ApplicationItem{" | 134 | "Kirigami.ApplicationItem{" | ||
135 | //purely cosmetic space | 135 | //purely cosmetic space, those magic values are to align perfectly within Systemsettings | ||
136 | "header: Item {height: Kirigami.Units.largeSpacing}" | 136 | "header: Item {height: Math.round(Kirigami.Units.gridUnit*0.25)}" | ||
137 | // allow only one column by default | 137 | // allow only one column by default | ||
138 | "pageStack.defaultColumnWidth:width;" | 138 | "pageStack.defaultColumnWidth:width;" | ||
139 | "pageStack.separatorVisible:false;" | 139 | "pageStack.separatorVisible:false;" | ||
140 | "pageStack.globalToolBar.style: pageStack.wideScreen ? Kirigami.ApplicationHeaderStyle.Titles : Kirigami.ApplicationHeaderStyle.Breadcrumb;" | 140 | "pageStack.globalToolBar.style: pageStack.wideScreen ? Kirigami.ApplicationHeaderStyle.Titles : Kirigami.ApplicationHeaderStyle.Breadcrumb;" | ||
141 | "pageStack.globalToolBar.showNavigationButtons:false;" | 141 | "pageStack.globalToolBar.showNavigationButtons:false;" | ||
142 | "pageStack.globalToolBar.preferredHeight:Kirigami.Units.gridUnit*1.6;" | 142 | "pageStack.globalToolBar.preferredHeight:Kirigami.Units.gridUnit*2;" | ||
143 | "pageStack.globalToolBar.separatorVisible:false;" | 143 | "pageStack.globalToolBar.separatorVisible:false;" | ||
144 | "activeFocusOnTab:true;" | 144 | "activeFocusOnTab:true;" | ||
145 | "Keys.onReturnPressed:{event.accepted=true}" | 145 | "Keys.onReturnPressed:{event.accepted=true}" | ||
146 | "Keys.onEnterPressed:{event.accepted=true}" | 146 | "Keys.onEnterPressed:{event.accepted=true}" | ||
147 | "}"), QUrl()); | 147 | "}"), QUrl()); | ||
148 | 148 | | |||
149 | d->rootPlaceHolder = qobject_cast<QQuickItem *>(component->create()); | 149 | d->rootPlaceHolder = qobject_cast<QQuickItem *>(component->create()); | ||
150 | d->quickWidget->setContent(QUrl(), component, d->rootPlaceHolder); | 150 | d->quickWidget->setContent(QUrl(), component, d->rootPlaceHolder); | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |