Add margins to dialog

pull/7/head
cutefishd 5 years ago
parent 355a465bc2
commit 11a77a171e

@ -18,6 +18,7 @@ ControlCenterDialog {
minimumHeight: _mainLayout.implicitHeight + Meui.Units.largeSpacing * 4
maximumHeight: _mainLayout.implicitHeight + Meui.Units.largeSpacing * 4
property var margin: 4 * Meui.Units.devicePixelRatio
property point position: Qt.point(0, 0)
onWidthChanged: adjustCorrectLocation()
@ -34,21 +35,10 @@ ControlCenterDialog {
var posX = control.position.x
var posY = control.position.y
// left
if (posX < 0)
posX = Meui.Units.largeSpacing
if (posX + control.width >= Screen.width)
posX = Screen.width - control.width - control.margin
// top
if (posY < 0)
posY = Meui.Units.largeSpacing
// right
if (posX + control.width > Screen.width)
posX = Screen.width - control.width
// bottom
if (posY > control.height > Screen.width)
posY = Screen.width - control.width - Meui.Units.largeSpacing
posY = rootItem.y + rootItem.height + control.margin
control.x = posX
control.y = posY

@ -232,55 +232,6 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
m_icon = imageVectorToPixmap(image);
}
// QString newTitle;
// QString newIconName;
// QString newToolTip;
// QString overlayIconName = properties[QStringLiteral("OverlayIconName")].toString();
// QString iconName = properties[QStringLiteral("IconName")].toString();
// bool changed = false;
// newTitle = properties[QStringLiteral("Title")].toString();
// if (!overlayIconName.isEmpty())
// newIconName = iconName;
// if (!iconName.isEmpty())
// newIconName = iconName;
// KDbusToolTipStruct toolTip;
// properties[QStringLiteral("ToolTip")].value<QDBusArgument>() >> toolTip;
// // newToolTip = !toolTip.title.isEmpty() ? toolTip.title : toolTip.subTitle;
// if (newTitle != m_title) {
// m_title = newTitle;
// changed = true;
// }
// if (newIconName != m_iconName) {
// m_iconName = iconName;
// changed = true;
// }
// if (newToolTip != m_tooltip) {
// m_tooltip = newToolTip;
// changed = true;
// }
// // Icon
// KDbusImageVector image;
// properties[QStringLiteral("AttentionIconPixmap")].value<QDBusArgument>() >> image;
// if (!image.isEmpty()) {
// m_icon = imageVectorToPixmap(image);
// changed = true;
// }
// properties[QStringLiteral("IconPixmap")].value<QDBusArgument>() >> image;
// if (!image.isEmpty()) {
// m_icon = imageVectorToPixmap(image);
// changed = true;
// }
// Menu
if (!m_menuImporter) {
QString menuObjectPath = properties[QStringLiteral("Menu")].value<QDBusObjectPath>().path();

Loading…
Cancel
Save