Improved desktop margins
This commit is contained in:
parent
a2764dc2e9
commit
d003a8dc1f
6 changed files with 20 additions and 4 deletions
|
@ -37,6 +37,7 @@ Desktop::Desktop(QObject *parent)
|
||||||
updateMargins();
|
updateMargins();
|
||||||
connect(&m_dockInterface, SIGNAL(primaryGeometryChanged()), this, SLOT(updateMargins()));
|
connect(&m_dockInterface, SIGNAL(primaryGeometryChanged()), this, SLOT(updateMargins()));
|
||||||
connect(&m_dockInterface, SIGNAL(directionChanged()), this, SLOT(updateMargins()));
|
connect(&m_dockInterface, SIGNAL(directionChanged()), this, SLOT(updateMargins()));
|
||||||
|
connect(&m_dockInterface, SIGNAL(visibilityChanged()), this, SLOT(updateMargins()));
|
||||||
} else {
|
} else {
|
||||||
QDBusServiceWatcher *watcher = new QDBusServiceWatcher("org.cutefish.Dock",
|
QDBusServiceWatcher *watcher = new QDBusServiceWatcher("org.cutefish.Dock",
|
||||||
QDBusConnection::sessionBus(),
|
QDBusConnection::sessionBus(),
|
||||||
|
@ -46,6 +47,7 @@ Desktop::Desktop(QObject *parent)
|
||||||
updateMargins();
|
updateMargins();
|
||||||
connect(&m_dockInterface, SIGNAL(primaryGeometryChanged()), this, SLOT(updateMargins()));
|
connect(&m_dockInterface, SIGNAL(primaryGeometryChanged()), this, SLOT(updateMargins()));
|
||||||
connect(&m_dockInterface, SIGNAL(directionChanged()), this, SLOT(updateMargins()));
|
connect(&m_dockInterface, SIGNAL(directionChanged()), this, SLOT(updateMargins()));
|
||||||
|
connect(&m_dockInterface, SIGNAL(visibilityChanged()), this, SLOT(updateMargins()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,11 +98,18 @@ void Desktop::updateMargins()
|
||||||
{
|
{
|
||||||
QRect dockGeometry = m_dockInterface.property("primaryGeometry").toRect();
|
QRect dockGeometry = m_dockInterface.property("primaryGeometry").toRect();
|
||||||
int dockDirection = m_dockInterface.property("direction").toInt();
|
int dockDirection = m_dockInterface.property("direction").toInt();
|
||||||
|
int visibility = m_dockInterface.property("visibility").toInt();
|
||||||
|
|
||||||
m_leftMargin = 0;
|
m_leftMargin = 0;
|
||||||
m_rightMargin = 0;
|
m_rightMargin = 0;
|
||||||
m_bottomMargin = 0;
|
m_bottomMargin = 0;
|
||||||
|
|
||||||
|
// AlwaysHide
|
||||||
|
if (visibility == 1) {
|
||||||
|
emit marginsChanged();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (dockDirection == 0) {
|
if (dockDirection == 0) {
|
||||||
m_leftMargin = dockGeometry.width();
|
m_leftMargin = dockGeometry.width();
|
||||||
} else if (dockDirection == 1) {
|
} else if (dockDirection == 1) {
|
||||||
|
|
|
@ -30,6 +30,9 @@ import "../"
|
||||||
Item {
|
Item {
|
||||||
id: rootItem
|
id: rootItem
|
||||||
|
|
||||||
|
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
|
||||||
|
LayoutMirroring.childrenInherit: true
|
||||||
|
|
||||||
GlobalSettings {
|
GlobalSettings {
|
||||||
id: globalSettings
|
id: globalSettings
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,8 +79,8 @@ Item {
|
||||||
id: _iconItem
|
id: _iconItem
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: FishUI.Units.largeSpacing
|
anchors.topMargin: FishUI.Units.smallSpacing
|
||||||
anchors.bottomMargin: FishUI.Units.largeSpacing
|
anchors.bottomMargin: FishUI.Units.smallSpacing
|
||||||
z: 2
|
z: 2
|
||||||
|
|
||||||
width: parent.width - FishUI.Units.largeSpacing * 2
|
width: parent.width - FishUI.Units.largeSpacing * 2
|
||||||
|
@ -189,7 +189,7 @@ Item {
|
||||||
anchors.top: _iconItem.bottom
|
anchors.top: _iconItem.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: FishUI.Units.smallSpacing
|
anchors.topMargin: FishUI.Units.smallSpacing
|
||||||
maximumLineCount: 2
|
maximumLineCount: control.selected ? 3 : 2
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
width: parent.width - FishUI.Units.largeSpacing * 2 - FishUI.Units.smallSpacing
|
width: parent.width - FishUI.Units.largeSpacing * 2 - FishUI.Units.smallSpacing
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
|
|
|
@ -221,7 +221,7 @@ GridView {
|
||||||
}
|
}
|
||||||
|
|
||||||
cellHeight: {
|
cellHeight: {
|
||||||
var iconHeight = iconSize + (FishUI.Units.fontMetrics.height * 2) + FishUI.Units.largeSpacing * 2
|
var iconHeight = iconSize + (FishUI.Units.fontMetrics.height * 3) + FishUI.Units.largeSpacing
|
||||||
if (isDesktopView) {
|
if (isDesktopView) {
|
||||||
var extraHeight = calcExtraSpacing(iconHeight, control.height - topMargin - bottomMargin)
|
var extraHeight = calcExtraSpacing(iconHeight, control.height - topMargin - bottomMargin)
|
||||||
return iconHeight + extraHeight
|
return iconHeight + extraHeight
|
||||||
|
|
|
@ -107,6 +107,7 @@ Item {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: _background
|
id: _background
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: 1
|
||||||
radius: FishUI.Theme.smallRadius
|
radius: FishUI.Theme.smallRadius
|
||||||
color: FishUI.Theme.secondBackgroundColor
|
color: FishUI.Theme.secondBackgroundColor
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,9 @@ FishUI.Window {
|
||||||
header.height: 36 + FishUI.Units.largeSpacing
|
header.height: 36 + FishUI.Units.largeSpacing
|
||||||
background.opacity: root.compositing ? 0.9 : 1.0
|
background.opacity: root.compositing ? 0.9 : 1.0
|
||||||
|
|
||||||
|
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
|
||||||
|
LayoutMirroring.childrenInherit: true
|
||||||
|
|
||||||
FishUI.WindowBlur {
|
FishUI.WindowBlur {
|
||||||
view: root
|
view: root
|
||||||
geometry: Qt.rect(root.x, root.y, root.width, root.height)
|
geometry: Qt.rect(root.x, root.y, root.width, root.height)
|
||||||
|
|
Loading…
Reference in a new issue