Changeset View
Changeset View
Standalone View
Standalone View
shell/panelview.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 58 | : PlasmaQuick::ContainmentView(corona, parent), | |||
---|---|---|---|---|---|
61 | m_minLength(0), | 61 | m_minLength(0), | ||
62 | m_contentLength(0), | 62 | m_contentLength(0), | ||
63 | m_distance(0), | 63 | m_distance(0), | ||
64 | m_thickness(30), | 64 | m_thickness(30), | ||
65 | m_initCompleted(false), | 65 | m_initCompleted(false), | ||
66 | m_alignment(Qt::AlignLeft), | 66 | m_alignment(Qt::AlignLeft), | ||
67 | m_corona(corona), | 67 | m_corona(corona), | ||
68 | m_visibilityMode(NormalPanel), | 68 | m_visibilityMode(NormalPanel), | ||
69 | m_opacityMode(Adaptive), | ||||
69 | m_backgroundHints(Plasma::Types::StandardBackground), | 70 | m_backgroundHints(Plasma::Types::StandardBackground), | ||
70 | m_shellSurface(nullptr) | 71 | m_shellSurface(nullptr) | ||
71 | { | 72 | { | ||
72 | if (targetScreen) { | 73 | if (targetScreen) { | ||
73 | setPosition(targetScreen->geometry().center()); | 74 | setPosition(targetScreen->geometry().center()); | ||
74 | setScreenToFollow(targetScreen); | 75 | setScreenToFollow(targetScreen); | ||
75 | setScreen(targetScreen); | 76 | setScreen(targetScreen); | ||
76 | } | 77 | } | ||
▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Line(s) | 385 | { | |||
406 | m_shellSurface->setPanelBehavior(behavior); | 407 | m_shellSurface->setPanelBehavior(behavior); | ||
407 | } | 408 | } | ||
408 | 409 | | |||
409 | PanelView::VisibilityMode PanelView::visibilityMode() const | 410 | PanelView::VisibilityMode PanelView::visibilityMode() const | ||
410 | { | 411 | { | ||
411 | return m_visibilityMode; | 412 | return m_visibilityMode; | ||
412 | } | 413 | } | ||
413 | 414 | | |||
415 | PanelView::OpacityMode PanelView::opacityMode() const | ||||
416 | { | ||||
417 | return m_opacityMode; | ||||
418 | } | ||||
419 | | ||||
420 | void PanelView::setOpacityMode(PanelView::OpacityMode mode) | ||||
421 | { | ||||
422 | if (m_opacityMode != mode) { | ||||
423 | m_opacityMode = mode; | ||||
424 | if (config().isValid() && config().parent().isValid()) { | ||||
425 | config().parent().writeEntry("panelOpacity", (int)mode); | ||||
426 | m_corona->requestApplicationConfigSync(); | ||||
427 | } | ||||
428 | emit opacityModeChanged(); | ||||
429 | } | ||||
430 | } | ||||
431 | | ||||
414 | void PanelView::positionPanel() | 432 | void PanelView::positionPanel() | ||
415 | { | 433 | { | ||
416 | if (!containment()) { | 434 | if (!containment()) { | ||
417 | return; | 435 | return; | ||
418 | } | 436 | } | ||
419 | 437 | | |||
420 | if (!m_initCompleted) { | 438 | if (!m_initCompleted) { | ||
421 | return; | 439 | return; | ||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Line(s) | 582 | { | |||
596 | m_maxLength = qBound<int>(MINSIZE, readConfigValueWithFallBack("maxLength", side), maxSize); | 614 | m_maxLength = qBound<int>(MINSIZE, readConfigValueWithFallBack("maxLength", side), maxSize); | ||
597 | m_minLength = qBound<int>(MINSIZE, readConfigValueWithFallBack("minLength", side), maxSize); | 615 | m_minLength = qBound<int>(MINSIZE, readConfigValueWithFallBack("minLength", side), maxSize); | ||
598 | 616 | | |||
599 | //panelVisibility is not resolution dependent | 617 | //panelVisibility is not resolution dependent | ||
600 | //but if fails read it from the resolution dependent one as | 618 | //but if fails read it from the resolution dependent one as | ||
601 | //the place for this config key is changed in Plasma 5.9 | 619 | //the place for this config key is changed in Plasma 5.9 | ||
602 | //Do NOT use readConfigValueWithFallBack | 620 | //Do NOT use readConfigValueWithFallBack | ||
603 | setVisibilityMode((VisibilityMode)config().parent().readEntry<int>("panelVisibility", config().readEntry<int>("panelVisibility", (int)NormalPanel))); | 621 | setVisibilityMode((VisibilityMode)config().parent().readEntry<int>("panelVisibility", config().readEntry<int>("panelVisibility", (int)NormalPanel))); | ||
622 | setOpacityMode((OpacityMode)config().parent().readEntry<int>("panelOpacity", config().readEntry<int>("panelOpacity", (int)Adaptive))); | ||||
604 | m_initCompleted = true; | 623 | m_initCompleted = true; | ||
605 | resizePanel(); | 624 | resizePanel(); | ||
606 | positionPanel(); | 625 | positionPanel(); | ||
607 | 626 | | |||
608 | emit maximumLengthChanged(); | 627 | emit maximumLengthChanged(); | ||
609 | emit minimumLengthChanged(); | 628 | emit minimumLengthChanged(); | ||
610 | emit offsetChanged(); | 629 | emit offsetChanged(); | ||
611 | emit alignmentChanged(); | 630 | emit alignmentChanged(); | ||
▲ Show 20 Lines • Show All 724 Lines • Show Last 20 Lines |