Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp
Show All 15 Lines | |||||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | #include "previewclient.h" | 20 | #include "previewclient.h" | ||
21 | #include <KDecoration2/Decoration> | 21 | #include <KDecoration2/Decoration> | ||
22 | #include <KDecoration2/DecoratedClient> | 22 | #include <KDecoration2/DecoratedClient> | ||
23 | 23 | | |||
24 | #include <KColorScheme> | | |||
25 | #include <KColorSchemeManager> | | |||
26 | | ||||
27 | #include <QDebug> | 24 | #include <QDebug> | ||
28 | #include <QCoreApplication> | 25 | #include <QCoreApplication> | ||
29 | #include <QEvent> | 26 | #include <QEvent> | ||
30 | #include <QModelIndex> | 27 | #include <QModelIndex> | ||
31 | 28 | | |||
32 | namespace KDecoration2 | 29 | namespace KDecoration2 | ||
33 | { | 30 | { | ||
34 | namespace Preview | 31 | namespace Preview | ||
35 | { | 32 | { | ||
36 | 33 | | |||
37 | PreviewClient::PreviewClient(DecoratedClient *c, Decoration *decoration) | 34 | PreviewClient::PreviewClient(DecoratedClient *c, Decoration *decoration) | ||
38 | : QObject(decoration) | 35 | : QObject(decoration) | ||
39 | , ApplicationMenuEnabledDecoratedClientPrivate(c, decoration) | 36 | , ApplicationMenuEnabledDecoratedClientPrivate(c, decoration) | ||
40 | , m_colorSchemeManager(new KColorSchemeManager(this)) | | |||
41 | , m_colorSchemeIndex(0) | | |||
42 | , m_icon(QIcon::fromTheme(QStringLiteral("start-here-kde"))) | 37 | , m_icon(QIcon::fromTheme(QStringLiteral("start-here-kde"))) | ||
43 | , m_iconName(m_icon.name()) | 38 | , m_iconName(m_icon.name()) | ||
44 | , m_palette(QStringLiteral("kdeglobals")) | 39 | , m_palette(QStringLiteral("kdeglobals")) | ||
45 | , m_active(true) | 40 | , m_active(true) | ||
46 | , m_closeable(true) | 41 | , m_closeable(true) | ||
47 | , m_keepBelow(false) | 42 | , m_keepBelow(false) | ||
48 | , m_keepAbove(false) | 43 | , m_keepAbove(false) | ||
49 | , m_maximizable(true) | 44 | , m_maximizable(true) | ||
▲ Show 20 Lines • Show All 217 Lines • ▼ Show 20 Line(s) | 261 | { | |||
267 | return m_palette.palette(); | 262 | return m_palette.palette(); | ||
268 | } | 263 | } | ||
269 | 264 | | |||
270 | QColor PreviewClient::color(ColorGroup group, ColorRole role) const | 265 | QColor PreviewClient::color(ColorGroup group, ColorRole role) const | ||
271 | { | 266 | { | ||
272 | return m_palette.color(group, role); | 267 | return m_palette.color(group, role); | ||
273 | } | 268 | } | ||
274 | 269 | | |||
275 | QAbstractItemModel *PreviewClient::colorSchemeModel() const | | |||
276 | { | | |||
277 | return m_colorSchemeManager->model(); | | |||
278 | } | | |||
279 | | ||||
280 | int PreviewClient::colorSchemeIndex() const | | |||
281 | { | | |||
282 | return m_colorSchemeIndex; | | |||
283 | } | | |||
284 | | ||||
285 | void PreviewClient::setColorSchemeIndex(int index) | | |||
286 | { | | |||
287 | if (m_colorSchemeIndex == index) { | | |||
288 | return; | | |||
289 | } | | |||
290 | m_colorSchemeIndex = index; | | |||
291 | emit colorSchemeIndexChanged(m_colorSchemeIndex); | | |||
292 | } | | |||
293 | | ||||
294 | Qt::Edges PreviewClient::adjacentScreenEdges() const | 270 | Qt::Edges PreviewClient::adjacentScreenEdges() const | ||
295 | { | 271 | { | ||
296 | Qt::Edges edges; | 272 | Qt::Edges edges; | ||
297 | if (m_bordersBottomEdge) { | 273 | if (m_bordersBottomEdge) { | ||
298 | edges |= Qt::BottomEdge; | 274 | edges |= Qt::BottomEdge; | ||
299 | } | 275 | } | ||
300 | if (m_bordersLeftEdge) { | 276 | if (m_bordersLeftEdge) { | ||
301 | edges |= Qt::LeftEdge; | 277 | edges |= Qt::LeftEdge; | ||
▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines |