You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.6 KiB
QML
82 lines
2.6 KiB
QML
6 years ago
|
/*
|
||
|
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
|
||
|
*
|
||
|
* This file is part of Latte-Dock
|
||
|
*
|
||
|
* Latte-Dock is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU General Public License as
|
||
|
* published by the Free Software Foundation; either version 2 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
|
* Latte-Dock is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
|
import QtQuick 2.7
|
||
6 years ago
|
import QtGraphicalEffects 1.0
|
||
6 years ago
|
import QtQuick.Layouts 1.1
|
||
6 years ago
|
|
||
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||
6 years ago
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||
6 years ago
|
|
||
6 years ago
|
import "controls" as SettingsControls
|
||
6 years ago
|
import "maxlength" as MaximumLength
|
||
|
|
||
5 years ago
|
//import "../../code/ColorizerTools.js" as ColorizerTools
|
||
6 years ago
|
|
||
6 years ago
|
Item{
|
||
6 years ago
|
id: settingsRoot
|
||
6 years ago
|
readonly property bool containsMouse: false /*headerSettings.containsMouse || ruler.containsMouse
|
||
|
|| tooltipMouseArea.containsMouse || editBackMouseArea.containsMouse*/
|
||
5 years ago
|
readonly property int thickness: ruler.thickness + headerSettings.thickness + spacing * 6
|
||
6 years ago
|
readonly property int spacing: 4
|
||
6 years ago
|
|
||
6 years ago
|
property int textShadow: {
|
||
|
if (textColorIsDark) {
|
||
|
return 1;
|
||
|
} else {
|
||
|
return 6;
|
||
|
}
|
||
6 years ago
|
}
|
||
|
|
||
6 years ago
|
property string tooltip: ""
|
||
|
|
||
5 years ago
|
readonly property real textColorBrightness: 150// ColorizerTools.colorBrightness(textColor)
|
||
6 years ago
|
readonly property bool textColorIsDark: textColorBrightness < 127.5
|
||
6 years ago
|
|
||
|
readonly property color bestContrastedTextColor: {
|
||
5 years ago
|
if (imageTiler.opacity <= 0.4 && !plasmoid.configuration.inConfigureAppletsMode && themeExtended) {
|
||
|
return latteView.colorizer.currentBackgroundBrightness > 127.5 ?
|
||
6 years ago
|
themeExtended.lightTheme.textColor :
|
||
|
themeExtended.darkTheme.textColor;
|
||
6 years ago
|
}
|
||
6 years ago
|
|
||
|
return latteView && latteView.layout ? latteView.layout.textColor : "#D7E3FF";
|
||
6 years ago
|
}
|
||
6 years ago
|
|
||
6 years ago
|
readonly property color textColor: bestContrastedTextColor
|
||
|
|
||
6 years ago
|
layer.enabled: graphicsSystem.isAccelerated
|
||
6 years ago
|
layer.effect: DropShadow{
|
||
|
radius: settingsRoot.textShadow
|
||
|
fast: true
|
||
|
samples: 2 * radius
|
||
|
color: root.appShadowColorSolid
|
||
|
}
|
||
6 years ago
|
|
||
6 years ago
|
HeaderSettings{
|
||
|
id: headerSettings
|
||
|
}
|
||
6 years ago
|
|
||
6 years ago
|
MaximumLength.Ruler {
|
||
|
id: ruler
|
||
6 years ago
|
thicknessMargin: headerSettings.thickness + 3 * spacing
|
||
|
thickMargin: 3
|
||
6 years ago
|
}
|
||
6 years ago
|
}
|