Changeset View
Changeset View
Standalone View
Standalone View
options.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 88 | Options::Options(QObject *parent) | |||
---|---|---|---|---|---|
101 | , m_borderSnapZone(0) | 101 | , m_borderSnapZone(0) | ||
102 | , m_windowSnapZone(0) | 102 | , m_windowSnapZone(0) | ||
103 | , m_centerSnapZone(0) | 103 | , m_centerSnapZone(0) | ||
104 | , m_snapOnlyWhenOverlapping(false) | 104 | , m_snapOnlyWhenOverlapping(false) | ||
105 | , m_rollOverDesktops(false) | 105 | , m_rollOverDesktops(false) | ||
106 | , m_focusStealingPreventionLevel(0) | 106 | , m_focusStealingPreventionLevel(0) | ||
107 | , m_killPingTimeout(0) | 107 | , m_killPingTimeout(0) | ||
108 | , m_hideUtilityWindowsForInactive(false) | 108 | , m_hideUtilityWindowsForInactive(false) | ||
109 | , m_inactiveTabsSkipTaskbar(false) | | |||
110 | , m_autogroupSimilarWindows(false) | | |||
111 | , m_autogroupInForeground(false) | | |||
112 | , m_compositingMode(Options::defaultCompositingMode()) | 109 | , m_compositingMode(Options::defaultCompositingMode()) | ||
113 | , m_useCompositing(Options::defaultUseCompositing()) | 110 | , m_useCompositing(Options::defaultUseCompositing()) | ||
114 | , m_hiddenPreviews(Options::defaultHiddenPreviews()) | 111 | , m_hiddenPreviews(Options::defaultHiddenPreviews()) | ||
115 | , m_glSmoothScale(Options::defaultGlSmoothScale()) | 112 | , m_glSmoothScale(Options::defaultGlSmoothScale()) | ||
116 | , m_xrenderSmoothScale(Options::defaultXrenderSmoothScale()) | 113 | , m_xrenderSmoothScale(Options::defaultXrenderSmoothScale()) | ||
117 | , m_maxFpsInterval(Options::defaultMaxFpsInterval()) | 114 | , m_maxFpsInterval(Options::defaultMaxFpsInterval()) | ||
118 | , m_refreshRate(Options::defaultRefreshRate()) | 115 | , m_refreshRate(Options::defaultRefreshRate()) | ||
119 | , m_vBlankTime(Options::defaultVBlankTime()) | 116 | , m_vBlankTime(Options::defaultVBlankTime()) | ||
▲ Show 20 Lines • Show All 434 Lines • ▼ Show 20 Line(s) | |||||
554 | { | 551 | { | ||
555 | if (m_hideUtilityWindowsForInactive == hideUtilityWindowsForInactive) { | 552 | if (m_hideUtilityWindowsForInactive == hideUtilityWindowsForInactive) { | ||
556 | return; | 553 | return; | ||
557 | } | 554 | } | ||
558 | m_hideUtilityWindowsForInactive = hideUtilityWindowsForInactive; | 555 | m_hideUtilityWindowsForInactive = hideUtilityWindowsForInactive; | ||
559 | emit hideUtilityWindowsForInactiveChanged(); | 556 | emit hideUtilityWindowsForInactiveChanged(); | ||
560 | } | 557 | } | ||
561 | 558 | | |||
562 | void Options::setInactiveTabsSkipTaskbar(bool inactiveTabsSkipTaskbar) | | |||
563 | { | | |||
564 | if (m_inactiveTabsSkipTaskbar == inactiveTabsSkipTaskbar) { | | |||
565 | return; | | |||
566 | } | | |||
567 | m_inactiveTabsSkipTaskbar = inactiveTabsSkipTaskbar; | | |||
568 | emit inactiveTabsSkipTaskbarChanged(); | | |||
569 | } | | |||
570 | | ||||
571 | void Options::setAutogroupSimilarWindows(bool autogroupSimilarWindows) | | |||
572 | { | | |||
573 | if (m_autogroupSimilarWindows == autogroupSimilarWindows) { | | |||
574 | return; | | |||
575 | } | | |||
576 | m_autogroupSimilarWindows = autogroupSimilarWindows; | | |||
577 | emit autogroupSimilarWindowsChanged(); | | |||
578 | } | | |||
579 | | ||||
580 | void Options::setAutogroupInForeground(bool autogroupInForeground) | | |||
581 | { | | |||
582 | if (m_autogroupInForeground == autogroupInForeground) { | | |||
583 | return; | | |||
584 | } | | |||
585 | m_autogroupInForeground = autogroupInForeground; | | |||
586 | emit autogroupInForegroundChanged(); | | |||
587 | } | | |||
588 | | ||||
589 | void Options::setCompositingMode(int compositingMode) | 559 | void Options::setCompositingMode(int compositingMode) | ||
590 | { | 560 | { | ||
591 | if (m_compositingMode == static_cast<CompositingType>(compositingMode)) { | 561 | if (m_compositingMode == static_cast<CompositingType>(compositingMode)) { | ||
592 | return; | 562 | return; | ||
593 | } | 563 | } | ||
594 | m_compositingMode = static_cast<CompositingType>(compositingMode); | 564 | m_compositingMode = static_cast<CompositingType>(compositingMode); | ||
595 | emit compositingModeChanged(); | 565 | emit compositingModeChanged(); | ||
596 | } | 566 | } | ||
▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Line(s) | 746 | { | |||
783 | OpTitlebarDblClick = windowOperation(config.readEntry("TitlebarDoubleClickCommand", "Maximize"), true); | 753 | OpTitlebarDblClick = windowOperation(config.readEntry("TitlebarDoubleClickCommand", "Maximize"), true); | ||
784 | setOperationMaxButtonLeftClick(windowOperation(config.readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true)); | 754 | setOperationMaxButtonLeftClick(windowOperation(config.readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true)); | ||
785 | setOperationMaxButtonMiddleClick(windowOperation(config.readEntry("MaximizeButtonMiddleClickCommand", "Maximize (vertical only)"), true)); | 755 | setOperationMaxButtonMiddleClick(windowOperation(config.readEntry("MaximizeButtonMiddleClickCommand", "Maximize (vertical only)"), true)); | ||
786 | setOperationMaxButtonRightClick(windowOperation(config.readEntry("MaximizeButtonRightClickCommand", "Maximize (horizontal only)"), true)); | 756 | setOperationMaxButtonRightClick(windowOperation(config.readEntry("MaximizeButtonRightClickCommand", "Maximize (horizontal only)"), true)); | ||
787 | 757 | | |||
788 | // Mouse bindings | 758 | // Mouse bindings | ||
789 | config = KConfigGroup(m_settings->config(), "MouseBindings"); | 759 | config = KConfigGroup(m_settings->config(), "MouseBindings"); | ||
790 | // TODO: add properties for missing options | 760 | // TODO: add properties for missing options | ||
791 | CmdTitlebarWheel = mouseWheelCommand(config.readEntry("CommandTitlebarWheel", "Switch to Window Tab to the Left/Right")); | 761 | CmdTitlebarWheel = mouseWheelCommand(config.readEntry("CommandTitlebarWheel", "Nothing")); | ||
792 | CmdAllModKey = (config.readEntry("CommandAllKey", "Alt") == QStringLiteral("Meta")) ? Qt::Key_Meta : Qt::Key_Alt; | 762 | CmdAllModKey = (config.readEntry("CommandAllKey", "Alt") == QStringLiteral("Meta")) ? Qt::Key_Meta : Qt::Key_Alt; | ||
793 | CmdAllWheel = mouseWheelCommand(config.readEntry("CommandAllWheel", "Nothing")); | 763 | CmdAllWheel = mouseWheelCommand(config.readEntry("CommandAllWheel", "Nothing")); | ||
794 | setCommandActiveTitlebar1(mouseCommand(config.readEntry("CommandActiveTitlebar1", "Raise"), true)); | 764 | setCommandActiveTitlebar1(mouseCommand(config.readEntry("CommandActiveTitlebar1", "Raise"), true)); | ||
795 | setCommandActiveTitlebar2(mouseCommand(config.readEntry("CommandActiveTitlebar2", "Start Window Tab Drag"), true)); | 765 | setCommandActiveTitlebar2(mouseCommand(config.readEntry("CommandActiveTitlebar2", "Nothing"), true)); | ||
796 | setCommandActiveTitlebar3(mouseCommand(config.readEntry("CommandActiveTitlebar3", "Operations menu"), true)); | 766 | setCommandActiveTitlebar3(mouseCommand(config.readEntry("CommandActiveTitlebar3", "Operations menu"), true)); | ||
797 | setCommandInactiveTitlebar1(mouseCommand(config.readEntry("CommandInactiveTitlebar1", "Activate and raise"), true)); | 767 | setCommandInactiveTitlebar1(mouseCommand(config.readEntry("CommandInactiveTitlebar1", "Activate and raise"), true)); | ||
798 | setCommandInactiveTitlebar2(mouseCommand(config.readEntry("CommandInactiveTitlebar2", "Start Window Tab Drag"), true)); | 768 | setCommandInactiveTitlebar2(mouseCommand(config.readEntry("CommandInactiveTitlebar2", "Nothing"), true)); | ||
799 | setCommandInactiveTitlebar3(mouseCommand(config.readEntry("CommandInactiveTitlebar3", "Operations menu"), true)); | 769 | setCommandInactiveTitlebar3(mouseCommand(config.readEntry("CommandInactiveTitlebar3", "Operations menu"), true)); | ||
800 | setCommandWindow1(mouseCommand(config.readEntry("CommandWindow1", "Activate, raise and pass click"), false)); | 770 | setCommandWindow1(mouseCommand(config.readEntry("CommandWindow1", "Activate, raise and pass click"), false)); | ||
801 | setCommandWindow2(mouseCommand(config.readEntry("CommandWindow2", "Activate and pass click"), false)); | 771 | setCommandWindow2(mouseCommand(config.readEntry("CommandWindow2", "Activate and pass click"), false)); | ||
802 | setCommandWindow3(mouseCommand(config.readEntry("CommandWindow3", "Activate and pass click"), false)); | 772 | setCommandWindow3(mouseCommand(config.readEntry("CommandWindow3", "Activate and pass click"), false)); | ||
803 | setCommandWindowWheel(mouseCommand(config.readEntry("CommandWindowWheel", "Scroll"), false)); | 773 | setCommandWindowWheel(mouseCommand(config.readEntry("CommandWindowWheel", "Scroll"), false)); | ||
804 | setCommandAll1(mouseCommand(config.readEntry("CommandAll1", "Move"), false)); | 774 | setCommandAll1(mouseCommand(config.readEntry("CommandAll1", "Move"), false)); | ||
805 | setCommandAll2(mouseCommand(config.readEntry("CommandAll2", "Toggle raise and lower"), false)); | 775 | setCommandAll2(mouseCommand(config.readEntry("CommandAll2", "Toggle raise and lower"), false)); | ||
806 | setCommandAll3(mouseCommand(config.readEntry("CommandAll3", "Resize"), false)); | 776 | setCommandAll3(mouseCommand(config.readEntry("CommandAll3", "Resize"), false)); | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 816 | #endif | |||
852 | setShadeHoverInterval(m_settings->shadeHoverInterval()); | 822 | setShadeHoverInterval(m_settings->shadeHoverInterval()); | ||
853 | setClickRaise(m_settings->clickRaise()); | 823 | setClickRaise(m_settings->clickRaise()); | ||
854 | setBorderSnapZone(m_settings->borderSnapZone()); | 824 | setBorderSnapZone(m_settings->borderSnapZone()); | ||
855 | setWindowSnapZone(m_settings->windowSnapZone()); | 825 | setWindowSnapZone(m_settings->windowSnapZone()); | ||
856 | setCenterSnapZone(m_settings->centerSnapZone()); | 826 | setCenterSnapZone(m_settings->centerSnapZone()); | ||
857 | setSnapOnlyWhenOverlapping(m_settings->snapOnlyWhenOverlapping()); | 827 | setSnapOnlyWhenOverlapping(m_settings->snapOnlyWhenOverlapping()); | ||
858 | setKillPingTimeout(m_settings->killPingTimeout()); | 828 | setKillPingTimeout(m_settings->killPingTimeout()); | ||
859 | setHideUtilityWindowsForInactive(m_settings->hideUtilityWindowsForInactive()); | 829 | setHideUtilityWindowsForInactive(m_settings->hideUtilityWindowsForInactive()); | ||
860 | setInactiveTabsSkipTaskbar(m_settings->inactiveTabsSkipTaskbar()); | | |||
861 | setAutogroupSimilarWindows(m_settings->autogroupSimilarWindows()); | | |||
862 | setAutogroupInForeground(m_settings->autogroupInForeground()); | | |||
863 | setBorderlessMaximizedWindows(m_settings->borderlessMaximizedWindows()); | 830 | setBorderlessMaximizedWindows(m_settings->borderlessMaximizedWindows()); | ||
864 | setElectricBorderMaximize(m_settings->electricBorderMaximize()); | 831 | setElectricBorderMaximize(m_settings->electricBorderMaximize()); | ||
865 | setElectricBorderTiling(m_settings->electricBorderTiling()); | 832 | setElectricBorderTiling(m_settings->electricBorderTiling()); | ||
866 | setElectricBorderCornerRatio(m_settings->electricBorderCornerRatio()); | 833 | setElectricBorderCornerRatio(m_settings->electricBorderCornerRatio()); | ||
867 | setWindowsBlockCompositing(m_settings->windowsBlockCompositing()); | 834 | setWindowsBlockCompositing(m_settings->windowsBlockCompositing()); | ||
868 | 835 | | |||
869 | } | 836 | } | ||
870 | 837 | | |||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 992 | { | |||
1037 | if (lowerName == QStringLiteral("activate and scroll")) return MouseActivateAndPassClick; | 1004 | if (lowerName == QStringLiteral("activate and scroll")) return MouseActivateAndPassClick; | ||
1038 | if (lowerName == QStringLiteral("activate, raise and scroll")) return MouseActivateRaiseAndPassClick; | 1005 | if (lowerName == QStringLiteral("activate, raise and scroll")) return MouseActivateRaiseAndPassClick; | ||
1039 | if (lowerName == QStringLiteral("activate, raise and move")) | 1006 | if (lowerName == QStringLiteral("activate, raise and move")) | ||
1040 | return restricted ? MouseActivateRaiseAndMove : MouseActivateRaiseAndUnrestrictedMove; | 1007 | return restricted ? MouseActivateRaiseAndMove : MouseActivateRaiseAndUnrestrictedMove; | ||
1041 | if (lowerName == QStringLiteral("move")) return restricted ? MouseMove : MouseUnrestrictedMove; | 1008 | if (lowerName == QStringLiteral("move")) return restricted ? MouseMove : MouseUnrestrictedMove; | ||
1042 | if (lowerName == QStringLiteral("resize")) return restricted ? MouseResize : MouseUnrestrictedResize; | 1009 | if (lowerName == QStringLiteral("resize")) return restricted ? MouseResize : MouseUnrestrictedResize; | ||
1043 | if (lowerName == QStringLiteral("shade")) return MouseShade; | 1010 | if (lowerName == QStringLiteral("shade")) return MouseShade; | ||
1044 | if (lowerName == QStringLiteral("minimize")) return MouseMinimize; | 1011 | if (lowerName == QStringLiteral("minimize")) return MouseMinimize; | ||
1045 | if (lowerName == QStringLiteral("start window tab drag")) return MouseDragTab; | | |||
1046 | if (lowerName == QStringLiteral("close")) return MouseClose; | 1012 | if (lowerName == QStringLiteral("close")) return MouseClose; | ||
1047 | if (lowerName == QStringLiteral("increase opacity")) return MouseOpacityMore; | 1013 | if (lowerName == QStringLiteral("increase opacity")) return MouseOpacityMore; | ||
1048 | if (lowerName == QStringLiteral("decrease opacity")) return MouseOpacityLess; | 1014 | if (lowerName == QStringLiteral("decrease opacity")) return MouseOpacityLess; | ||
1049 | if (lowerName == QStringLiteral("nothing")) return MouseNothing; | 1015 | if (lowerName == QStringLiteral("nothing")) return MouseNothing; | ||
1050 | return MouseNothing; | 1016 | return MouseNothing; | ||
1051 | } | 1017 | } | ||
1052 | 1018 | | |||
1053 | Options::MouseWheelCommand Options::mouseWheelCommand(const QString &name) | 1019 | Options::MouseWheelCommand Options::mouseWheelCommand(const QString &name) | ||
1054 | { | 1020 | { | ||
1055 | QString lowerName = name.toLower(); | 1021 | QString lowerName = name.toLower(); | ||
1056 | if (lowerName == QStringLiteral("raise/lower")) return MouseWheelRaiseLower; | 1022 | if (lowerName == QStringLiteral("raise/lower")) return MouseWheelRaiseLower; | ||
1057 | if (lowerName == QStringLiteral("shade/unshade")) return MouseWheelShadeUnshade; | 1023 | if (lowerName == QStringLiteral("shade/unshade")) return MouseWheelShadeUnshade; | ||
1058 | if (lowerName == QStringLiteral("maximize/restore")) return MouseWheelMaximizeRestore; | 1024 | if (lowerName == QStringLiteral("maximize/restore")) return MouseWheelMaximizeRestore; | ||
1059 | if (lowerName == QStringLiteral("above/below")) return MouseWheelAboveBelow; | 1025 | if (lowerName == QStringLiteral("above/below")) return MouseWheelAboveBelow; | ||
1060 | if (lowerName == QStringLiteral("previous/next desktop")) return MouseWheelPreviousNextDesktop; | 1026 | if (lowerName == QStringLiteral("previous/next desktop")) return MouseWheelPreviousNextDesktop; | ||
1061 | if (lowerName == QStringLiteral("change opacity")) return MouseWheelChangeOpacity; | 1027 | if (lowerName == QStringLiteral("change opacity")) return MouseWheelChangeOpacity; | ||
1062 | if (lowerName == QStringLiteral("switch to window tab to the left/right")) return MouseWheelChangeCurrentTab; | | |||
1063 | if (lowerName == QStringLiteral("nothing")) return MouseWheelNothing; | 1028 | if (lowerName == QStringLiteral("nothing")) return MouseWheelNothing; | ||
1064 | return MouseWheelChangeCurrentTab; | 1029 | return MouseWheelNothing; | ||
1065 | } | 1030 | } | ||
1066 | 1031 | | |||
1067 | bool Options::showGeometryTip() const | 1032 | bool Options::showGeometryTip() const | ||
1068 | { | 1033 | { | ||
1069 | return show_geometry_tip; | 1034 | return show_geometry_tip; | ||
1070 | } | 1035 | } | ||
1071 | 1036 | | |||
1072 | bool Options::condensedTitle() const | 1037 | bool Options::condensedTitle() const | ||
Show All 11 Lines | 1043 | { | |||
1084 | case MouseWheelMaximizeRestore: | 1049 | case MouseWheelMaximizeRestore: | ||
1085 | return delta > 0 ? MouseMaximize : MouseRestore; | 1050 | return delta > 0 ? MouseMaximize : MouseRestore; | ||
1086 | case MouseWheelAboveBelow: | 1051 | case MouseWheelAboveBelow: | ||
1087 | return delta > 0 ? MouseAbove : MouseBelow; | 1052 | return delta > 0 ? MouseAbove : MouseBelow; | ||
1088 | case MouseWheelPreviousNextDesktop: | 1053 | case MouseWheelPreviousNextDesktop: | ||
1089 | return delta > 0 ? MousePreviousDesktop : MouseNextDesktop; | 1054 | return delta > 0 ? MousePreviousDesktop : MouseNextDesktop; | ||
1090 | case MouseWheelChangeOpacity: | 1055 | case MouseWheelChangeOpacity: | ||
1091 | return delta > 0 ? MouseOpacityMore : MouseOpacityLess; | 1056 | return delta > 0 ? MouseOpacityMore : MouseOpacityLess; | ||
1092 | case MouseWheelChangeCurrentTab: | | |||
1093 | return delta > 0 ? MousePreviousTab : MouseNextTab; | | |||
1094 | default: | 1057 | default: | ||
1095 | return MouseNothing; | 1058 | return MouseNothing; | ||
1096 | } | 1059 | } | ||
1097 | } | 1060 | } | ||
1098 | #endif | 1061 | #endif | ||
1099 | 1062 | | |||
1100 | double Options::animationTimeFactor() const | 1063 | double Options::animationTimeFactor() const | ||
1101 | { | 1064 | { | ||
Show All 22 Lines |