Skip to content

UniDeskAppBar Type ​

Application top bar control providing a Windows 11-style title bar. Includes window title, minimize/maximize (restore)/close buttons, and an optional stay-on-top button.

ItemDescription
Control TypeVisual Control
Source FileUniDesk/Controls/UniDeskAppBar.qml
InheritsQtQuick Rectangle
QML Importimport UniDesk.Controls 1.0

Custom Properties ​

PropertyTypeDefaultDescription
titlestring""Window title
minimizeTextstring"Minimize"Minimize button tooltip
restoreTextstring"Restore"Restore button tooltip
maximizeTextstring"Maximize"Maximize button tooltip
closeTextstring"Close"Close button tooltip
showDarkboolfalseUse dark style
showClosebooltrueShow close button
showMinimizebooltrueShow minimize button
showMaximizebooltrueShow maximize button
showStayTopbooltrueShow stay-on-top button
titleVisiblebooltrueWhether title is visible
iconurl—Window icon
iconSizeint20Icon size
isMacboolauto-detectedWhether on macOS (read-only, auto-detected by UniDeskUtils.isMacos())

Overridable Click Handlers ​

PropertyTypeDescription
maxClickListenervar (function)Maximize button click handler. Default: toggles window maximize/restore
minClickListenervar (function)Minimize button click handler. Default: minimizes the window
closeClickListenervar (function)Close button click handler. Default: closes the window

Child Aliases ​

PropertyDescription
buttonMinimizeMinimize button (UniDeskButton)
buttonMaximizeMaximize/restore button (UniDeskButton)
buttonCloseClose button (UniDeskButton)
layoutStandardbuttonsButton layout container

Behavior ​

  • Auto-adapts to window state: maximize toggles to restore icon and text
  • Clicking buttons triggers corresponding window operations (minimize, maximize/restore, close)
  • Button colors auto-adapt to light/dark themes
  • Height: 30px when visible, 0px when hidden

Example ​

qml
import UniDesk.Controls 1.0

UniDeskWindow {
    width: 600
    height: 400

    UniDeskAppBar {
        anchors.top: parent.top
        anchors.left: parent.left
        anchors.right: parent.right
        title: "My App"
        showStayTop: false
    }
}

Released under the CC BY-SA 4.0 open documentation license.