mirror of https://github.com/cutefishos/fishui
Rename to FishUI
parent
182ce17393
commit
1a081b30d7
@ -1,10 +1,13 @@
|
||||
# MeuiKit
|
||||
# FishUI
|
||||
|
||||
```bash
|
||||
sudo apt install libqt5x11extras5-dev libkf5windowsystem-dev -y
|
||||
```
|
||||
|
||||
## Build
|
||||
Before build, make sure you have necessary Qt environment.
|
||||
|
||||
```
|
||||
sudo apt install libqt5x11extras5-dev libkf5windowsystem-dev -y
|
||||
```bash
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
|
||||
make
|
||||
sudo make install
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Templates 2.4 as T
|
||||
import FishUI 1.0 as FishUI
|
||||
import QtQuick.Controls.impl 2.4
|
||||
|
||||
T.Button
|
||||
{
|
||||
id: control
|
||||
implicitWidth: Math.max(background.implicitWidth, contentItem.implicitWidth + FishUI.Units.largeSpacing)
|
||||
implicitHeight: background.implicitHeight
|
||||
hoverEnabled: true
|
||||
|
||||
property color hoveredColor: Qt.tint(FishUI.Theme.textColor, Qt.rgba(FishUI.Theme.backgroundColor.r,
|
||||
FishUI.Theme.backgroundColor.g,
|
||||
FishUI.Theme.backgroundColor.b, 0.9))
|
||||
property color pressedColor: Qt.tint(FishUI.Theme.textColor, Qt.rgba(FishUI.Theme.backgroundColor.r,
|
||||
FishUI.Theme.backgroundColor.g,
|
||||
FishUI.Theme.backgroundColor.b, 0.8))
|
||||
|
||||
property color flatHoveredColor: Qt.lighter(FishUI.Theme.highlightColor, 1.1)
|
||||
property color flatPressedColor: Qt.darker(FishUI.Theme.highlightColor, 1.1)
|
||||
|
||||
icon.width: FishUI.Units.iconSizes.small
|
||||
icon.height: FishUI.Units.iconSizes.small
|
||||
|
||||
icon.color: control.enabled ? (control.highlighted ? control.FishUI.Theme.highlightColor : control.FishUI.Theme.textColor) : control.FishUI.Theme.disabledTextColor
|
||||
spacing: FishUI.Units.smallSpacing
|
||||
|
||||
contentItem: IconLabel {
|
||||
text: control.text
|
||||
font: control.font
|
||||
icon: control.icon
|
||||
color: !control.enabled ? control.FishUI.Theme.disabledTextColor : control.flat ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: Qt.AlignCenter
|
||||
}
|
||||
|
||||
background: Item {
|
||||
implicitWidth: (FishUI.Units.iconSizes.medium * 3) + FishUI.Units.largeSpacing + FishUI.Units.extendBorderWidth
|
||||
implicitHeight: FishUI.Units.iconSizes.medium + FishUI.Units.smallSpacing + FishUI.Units.extendBorderWidth
|
||||
|
||||
Rectangle {
|
||||
id: _border
|
||||
anchors.fill: parent
|
||||
visible: control.activeFocus
|
||||
color: "transparent"
|
||||
border.color: Qt.rgba(FishUI.Theme.highlightColor.r,
|
||||
FishUI.Theme.highlightColor.g,
|
||||
FishUI.Theme.highlightColor.b, 0.3)
|
||||
border.width: FishUI.Units.extendBorderWidth
|
||||
radius: FishUI.Theme.mediumRadius
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: FishUI.Units.extendBorderWidth
|
||||
radius: FishUI.Theme.mediumRadius - FishUI.Units.extendBorderWidth
|
||||
border.color: control.flat && control.enabled ? FishUI.Theme.highlightColor : control.activeFocus || control.pressed ? FishUI.Theme.highlightColor :
|
||||
Qt.tint(FishUI.Theme.textColor, Qt.rgba(FishUI.Theme.backgroundColor.r, FishUI.Theme.backgroundColor.g, FishUI.Theme.backgroundColor.b, 0.7))
|
||||
border.width: 1
|
||||
|
||||
color: control.flat && control.enabled ? control.pressed ? control.flatPressedColor : control.hovered ? control.flatHoveredColor : FishUI.Theme.highlightColor
|
||||
: control.pressed ? control.pressedColor : control.hovered ? control.hoveredColor : FishUI.Theme.backgroundColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Templates 2.3 as T
|
||||
import FishUI 1.0 as FishUI
|
||||
|
||||
T.Label {
|
||||
id: control
|
||||
|
||||
verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter
|
||||
|
||||
activeFocusOnTab: false
|
||||
//Text.NativeRendering is broken on non integer pixel ratios
|
||||
renderType: Window.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering
|
||||
|
||||
font.capitalization: FishUI.Theme.defaultFont.capitalization
|
||||
font.family: FishUI.Theme.defaultFont.family
|
||||
font.italic: FishUI.Theme.defaultFont.italic
|
||||
font.letterSpacing: FishUI.Theme.defaultFont.letterSpacing
|
||||
font.pointSize: FishUI.Theme.defaultFont.pointSize
|
||||
font.strikeout: FishUI.Theme.defaultFont.strikeout
|
||||
font.underline: FishUI.Theme.defaultFont.underline
|
||||
font.weight: FishUI.Theme.defaultFont.weight
|
||||
font.wordSpacing: FishUI.Theme.defaultFont.wordSpacing
|
||||
color: FishUI.Theme.textColor
|
||||
linkColor: FishUI.Theme.linkColor
|
||||
|
||||
opacity: enabled ? 1 : 0.6
|
||||
|
||||
Accessible.role: Accessible.StaticText
|
||||
Accessible.name: text
|
||||
}
|
||||
@ -1,20 +1,20 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import MeuiKit 1.0 as Meui
|
||||
import FishUI 1.0 as FishUI
|
||||
|
||||
T.MenuSeparator {
|
||||
id: control
|
||||
|
||||
implicitHeight: Meui.Units.smallSpacing + separator.height
|
||||
implicitHeight: FishUI.Units.smallSpacing + separator.height
|
||||
width: parent.width
|
||||
|
||||
background: Rectangle {
|
||||
id: separator
|
||||
anchors.centerIn: control
|
||||
width: control.width - Meui.Units.largeSpacing
|
||||
width: control.width - FishUI.Units.largeSpacing
|
||||
height: 1
|
||||
color: Meui.Theme.textColor
|
||||
color: FishUI.Theme.textColor
|
||||
opacity: 0.3
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/meui/kit">
|
||||
<qresource prefix="/fishui/kit">
|
||||
<file alias="BusyIndicator.qml">controls/BusyIndicator.qml</file>
|
||||
<file alias="Icon.qml">controls/Icon.qml</file>
|
||||
<file alias="MouseHover.qml">controls/MouseHover.qml</file>
|
||||
@ -1,68 +0,0 @@
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Templates 2.4 as T
|
||||
import MeuiKit 1.0 as Meui
|
||||
import QtQuick.Controls.impl 2.4
|
||||
|
||||
T.Button
|
||||
{
|
||||
id: control
|
||||
implicitWidth: Math.max(background.implicitWidth, contentItem.implicitWidth + Meui.Units.largeSpacing)
|
||||
implicitHeight: background.implicitHeight
|
||||
hoverEnabled: true
|
||||
|
||||
property color hoveredColor: Qt.tint(Meui.Theme.textColor, Qt.rgba(Meui.Theme.backgroundColor.r,
|
||||
Meui.Theme.backgroundColor.g,
|
||||
Meui.Theme.backgroundColor.b, 0.9))
|
||||
property color pressedColor: Qt.tint(Meui.Theme.textColor, Qt.rgba(Meui.Theme.backgroundColor.r,
|
||||
Meui.Theme.backgroundColor.g,
|
||||
Meui.Theme.backgroundColor.b, 0.8))
|
||||
|
||||
property color flatHoveredColor: Qt.lighter(Meui.Theme.highlightColor, 1.1)
|
||||
property color flatPressedColor: Qt.darker(Meui.Theme.highlightColor, 1.1)
|
||||
|
||||
icon.width: Meui.Units.iconSizes.small
|
||||
icon.height: Meui.Units.iconSizes.small
|
||||
|
||||
icon.color: control.enabled ? (control.highlighted ? control.Meui.Theme.highlightColor : control.Meui.Theme.textColor) : control.Meui.Theme.disabledTextColor
|
||||
spacing: Meui.Units.smallSpacing
|
||||
|
||||
contentItem: IconLabel {
|
||||
text: control.text
|
||||
font: control.font
|
||||
icon: control.icon
|
||||
color: !control.enabled ? control.Meui.Theme.disabledTextColor : control.flat ? Meui.Theme.highlightedTextColor : Meui.Theme.textColor
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: Qt.AlignCenter
|
||||
}
|
||||
|
||||
background: Item {
|
||||
implicitWidth: (Meui.Units.iconSizes.medium * 3) + Meui.Units.largeSpacing + Meui.Units.extendBorderWidth
|
||||
implicitHeight: Meui.Units.iconSizes.medium + Meui.Units.smallSpacing + Meui.Units.extendBorderWidth
|
||||
|
||||
Rectangle {
|
||||
id: _border
|
||||
anchors.fill: parent
|
||||
visible: control.activeFocus
|
||||
color: "transparent"
|
||||
border.color: Qt.rgba(Meui.Theme.highlightColor.r,
|
||||
Meui.Theme.highlightColor.g,
|
||||
Meui.Theme.highlightColor.b, 0.3)
|
||||
border.width: Meui.Units.extendBorderWidth
|
||||
radius: Meui.Theme.mediumRadius
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Meui.Units.extendBorderWidth
|
||||
radius: Meui.Theme.mediumRadius - Meui.Units.extendBorderWidth
|
||||
border.color: control.flat && control.enabled ? Meui.Theme.highlightColor : control.activeFocus || control.pressed ? Meui.Theme.highlightColor :
|
||||
Qt.tint(Meui.Theme.textColor, Qt.rgba(Meui.Theme.backgroundColor.r, Meui.Theme.backgroundColor.g, Meui.Theme.backgroundColor.b, 0.7))
|
||||
border.width: 1
|
||||
|
||||
color: control.flat && control.enabled ? control.pressed ? control.flatPressedColor : control.hovered ? control.flatHoveredColor : Meui.Theme.highlightColor
|
||||
: control.pressed ? control.pressedColor : control.hovered ? control.hoveredColor : Meui.Theme.backgroundColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Templates 2.3 as T
|
||||
import MeuiKit 1.0 as Meui
|
||||
|
||||
T.Label {
|
||||
id: control
|
||||
|
||||
verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter
|
||||
|
||||
activeFocusOnTab: false
|
||||
//Text.NativeRendering is broken on non integer pixel ratios
|
||||
renderType: Window.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering
|
||||
|
||||
font.capitalization: Meui.Theme.defaultFont.capitalization
|
||||
font.family: Meui.Theme.defaultFont.family
|
||||
font.italic: Meui.Theme.defaultFont.italic
|
||||
font.letterSpacing: Meui.Theme.defaultFont.letterSpacing
|
||||
font.pointSize: Meui.Theme.defaultFont.pointSize
|
||||
font.strikeout: Meui.Theme.defaultFont.strikeout
|
||||
font.underline: Meui.Theme.defaultFont.underline
|
||||
font.weight: Meui.Theme.defaultFont.weight
|
||||
font.wordSpacing: Meui.Theme.defaultFont.wordSpacing
|
||||
color: Meui.Theme.textColor
|
||||
linkColor: Meui.Theme.linkColor
|
||||
|
||||
opacity: enabled ? 1 : 0.6
|
||||
|
||||
Accessible.role: Accessible.StaticText
|
||||
Accessible.name: text
|
||||
}
|
||||
Loading…
Reference in New Issue