Commit 5779dde8 authored by Michail Vourlakos's avatar Michail Vourlakos

global menu,rename menuHidden to visible

Summary:
--as @mart requested we can rename "menuHidden" property
to "visible" in order to follow Qt naming

Test Plan:
--check that global menu applet is functioning the same
way as when using removed menuHidden property

Reviewers: #plasma, mart, davidedmundson

Reviewed By: #plasma, mart

Subscribers: mart, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17107
parent 3fa1cc6b
......@@ -104,7 +104,7 @@ Item {
Repeater {
id: buttonRepeater
model: !appMenuModel.menuHidden ? appMenuModel : null
model: appMenuModel.visible ? appMenuModel : null
PlasmaComponents.ToolButton {
readonly property int buttonIndex: index
......
......@@ -110,21 +110,21 @@ void AppMenuModel::setMenuAvailable(bool set)
{
if (m_menuAvailable != set) {
m_menuAvailable = set;
setMenuHidden(false);
setVisible(true);
emit menuAvailableChanged();
}
}
bool AppMenuModel::menuHidden() const
bool AppMenuModel::visible() const
{
return m_menuHidden;
return m_visible;
}
void AppMenuModel::setMenuHidden(bool hide)
void AppMenuModel::setVisible(bool visible)
{
if (m_menuHidden != hide) {
m_menuHidden = hide;
emit menuHiddenChanged();
if (m_visible != visible) {
m_visible = visible;
emit visibleChanged();
}
}
......@@ -232,14 +232,14 @@ void AppMenuModel::onActiveWindowChanged(WId id)
// lok at transient windows first
while (transientId) {
if (updateMenuFromWindowIfHasMenu(transientId)) {
setMenuHidden(false);
setVisible(true);
return;
}
transientId = KWindowInfo(transientId, nullptr, NET::WM2TransientFor).transientFor();
}
if (updateMenuFromWindowIfHasMenu(id)) {
setMenuHidden(false);
setVisible(true);
return;
}
......@@ -262,7 +262,7 @@ void AppMenuModel::onWindowChanged(WId id)
KWindowInfo info(id, NET::WMState | NET::WMGeometry);
const bool contained = m_screenGeometry.isNull() || m_screenGeometry.contains(info.geometry().center());
setMenuHidden(info.isMinimized() || !contained);
setVisible(contained && !info.isMinimized());
}
}
......
......@@ -40,7 +40,7 @@ class AppMenuModel : public QAbstractListModel, public QAbstractNativeEventFilte
Q_OBJECT
Q_PROPERTY(bool menuAvailable READ menuAvailable WRITE setMenuAvailable NOTIFY menuAvailableChanged)
Q_PROPERTY(bool menuHidden READ menuHidden NOTIFY menuHiddenChanged)
Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
Q_PROPERTY(QRect screenGeometry READ screenGeometry WRITE setScreenGeometry NOTIFY screenGeometryChanged)
......@@ -62,7 +62,7 @@ public:
bool menuAvailable() const;
void setMenuAvailable(bool set);
bool menuHidden() const;
bool visible() const;
QRect screenGeometry() const;
void setScreenGeometry(QRect geometry);
......@@ -76,19 +76,19 @@ protected:
private Q_SLOTS:
void onActiveWindowChanged(WId id);
void onWindowChanged(WId id);
void setMenuHidden(bool hide);
void setVisible(bool visible);
void update();
signals:
void menuAvailableChanged();
void menuHiddenChanged();
void modelNeedsUpdate();
void screenGeometryChanged();
void visibleChanged();
private:
bool m_menuAvailable;
bool m_menuHidden = false;
bool m_updatePending = false;
bool m_visible = true;
QRect m_screenGeometry;
......
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