History

API to hide desktop menubar while keeping menu items

Ada committed 1 year ago

Commit f5ea94e1 parent 1551c173 files · +65 −9Browse files

Showing the changes to interface/src/scripting/MenuScriptingInterface.h (1 of 3 files). Show all

Unified · Split

interface/src/scripting/MenuScriptingInterface.h+26−0
@@ -34,6 +34,8 @@ class MenuItemProperties; · 33 unmodified lines
34 * @hifi-interface34 * @hifi-interface
35 * @hifi-client-entity35 * @hifi-client-entity
36 * @hifi-avatar36 * @hifi-avatar
37 *
38 * @property {boolean} visible - <code>true</code> if the menu bar is visible on the desktop window.
37 */39 */
38 40
39/**41/**
@@ -48,6 +50,8 @@ class MenuItemProperties; · 8 unmodified lines
48 50
49class MenuScriptingInterface : public QObject {51class MenuScriptingInterface : public QObject {
50 Q_OBJECT52 Q_OBJECT
53 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged)
54
51 MenuScriptingInterface() { };55 MenuScriptingInterface() { };
52public:56public:
53 static MenuScriptingInterface* getInstance();57 static MenuScriptingInterface* getInstance();
@@ -218,6 +222,20 @@ public slots: · 164 unmodified lines
218 */222 */
219 void setMenuEnabled(const QString& menuName, bool isEnabled);223 void setMenuEnabled(const QString& menuName, bool isEnabled);
220 224
225 /*@jsdoc
226 * Sets the visibility of the desktop menubar.
227 * @function Menu.setVisible
228 * @param {boolean} visible - If <code>true</code>, the menubar is visible on the desktop window.
229 */
230 void setVisible(bool visible);
231
232 /*@jsdoc
233 * Gets the visibility of the desktop menubar.
234 * @function Menu.isVisible
235 * @returns {boolean} <code>true</code> if the menubar is visible on the desktop window.
236 */
237 bool isVisible();
238
221signals:239signals:
222 /*@jsdoc240 /*@jsdoc
223 * Triggered when a menu item is clicked or triggered by {@link Menu.triggerOption}.241 * Triggered when a menu item is clicked or triggered by {@link Menu.triggerOption}.
@@ -232,6 +250,14 @@ signals: · 8 unmodified lines
232 * Menu.menuItemEvent.connect(onMenuItemEvent);250 * Menu.menuItemEvent.connect(onMenuItemEvent);
233 */251 */
234 void menuItemEvent(const QString& menuItem);252 void menuItemEvent(const QString& menuItem);
253
254 /*@jsdoc
255 * Triggered when <code>Menu.visible</code> is changed.
256 * @function Menu.visibilityChanged
257 * @param {boolean} visible - <code>true</code> if the menubar is visible on the desktop window.
258 * @returns {Signal}
259 */
260 void visibilityChanged(bool visible);
235};261};
236 262
237#endif // hifi_MenuScriptingInterface_h263#endif // hifi_MenuScriptingInterface_h