Commit e3e92d46 authored by faenil's avatar faenil

Merge pull request #1 from sledges/master

[components] basic Slider and ProgressBar with reusable groove
parents c1d6bdcb 5eba4aa9
/*
* Copyright (C) 2013 Simonas Leleiva <simonas.leleiva@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
import QtQuick 2.1
import QtQuick.Controls.Styles.Nemo 1.0
Component {
Rectangle {
implicitHeight: 16
implicitWidth: 440
color: Theme.groove.backgroundColor
Rectangle {
antialiasing: true
radius: 1
color: Theme.groove.foregroundColor
height: parent.height
width: parent.width * control.value / control.maximumValue
}
}
}
...@@ -21,5 +21,9 @@ import QtQuick 2.1 ...@@ -21,5 +21,9 @@ import QtQuick 2.1
import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.0
ProgressBarStyle { ProgressBarStyle {
GrooveStyle {
id: grooveStyle
}
panel: grooveStyle;
} }
...@@ -21,5 +21,11 @@ import QtQuick 2.1 ...@@ -21,5 +21,11 @@ import QtQuick 2.1
import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.0
SliderStyle { SliderStyle {
GrooveStyle {
id: grooveStyle
}
handle: Item { }
groove: grooveStyle;
} }
...@@ -70,7 +70,11 @@ QtObject { ...@@ -70,7 +70,11 @@ QtObject {
edgeColor: themeConfig.primaryButton.pressedGradient.edgeColor edgeColor: themeConfig.primaryButton.pressedGradient.edgeColor
} }
}) })
}
property var groove:
({
foregroundColor: themeConfig.groove.foreground,
backgroundColor: themeConfig.groove.background,
})
}
...@@ -12,6 +12,7 @@ QML_FILES = \ ...@@ -12,6 +12,7 @@ QML_FILES = \
CheckBoxStyle.qml \ CheckBoxStyle.qml \
ComboBoxStyle.qml \ ComboBoxStyle.qml \
FocusFrameStyle.qml \ FocusFrameStyle.qml \
GrooveStyle.qml \
GroupBoxStyle.qml \ GroupBoxStyle.qml \
MenuBarStyle.qml \ MenuBarStyle.qml \
MenuStyle.qml \ MenuStyle.qml \
......
...@@ -23,6 +23,7 @@ var themeName = "Glacier" ...@@ -23,6 +23,7 @@ var themeName = "Glacier"
var accentColor = "#0091e5" var accentColor = "#0091e5"
var fillColor = "#474747" var fillColor = "#474747"
var fillColorDark = "#313131"
// BUTTON STYLING // BUTTON STYLING
var button = { var button = {
...@@ -42,3 +43,10 @@ var primaryButton = { ...@@ -42,3 +43,10 @@ var primaryButton = {
edgeColor: accentColor edgeColor: accentColor
} }
} }
// STYLE FOR SLIDER AND PROGRESS BAR GROOVES
var groove = {
foreground: accentColor,
background: fillColorDark,
}
...@@ -23,6 +23,7 @@ var themeName = "Ugly Test Theme" ...@@ -23,6 +23,7 @@ var themeName = "Ugly Test Theme"
var accentColor = "#FF7F00" var accentColor = "#FF7F00"
var fillColor = "#474747" var fillColor = "#474747"
var fillColorDark = "#202020"
// BUTTON STYLING // BUTTON STYLING
var button = { var button = {
...@@ -42,3 +43,10 @@ var primaryButton = { ...@@ -42,3 +43,10 @@ var primaryButton = {
edgeColor: accentColor edgeColor: accentColor
} }
} }
// STYLE FOR SLIDER AND PROGRESS BAR GROOVES
var groove = {
foreground: accentColor,
background: fillColorDark,
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment