Skip to content

Commit 196805f

Browse files
committed
fix(ui): allow custom QWindow menu icon
1 parent d1d30cd commit 196805f

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

packages/ui/src/components/QWindow.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,17 @@ export default defineComponent({
276276
* @category titlebar
277277
*/
278278
noMenu: Boolean,
279+
/**
280+
* Icon used by the built-in title bar actions menu button.
281+
*
282+
* @category titlebar
283+
* @default "more_vert"
284+
* @example menu-icon="more_horiz"
285+
*/
286+
menuIcon: {
287+
type: String,
288+
default: 'more_vert',
289+
},
279290
/**
280291
* Disables dragging by the title bar.
281292
*

packages/ui/src/components/composables/useToolbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default function useToolbar(
141141
flat: true,
142142
round: true,
143143
dense: true,
144-
icon: 'more_vert',
144+
icon: props.menuIcon,
145145
},
146146
() => [renderMenu(menuData)],
147147
)

packages/ui/test/QWindow.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ describe('QWindow exports', () => {
9595
QWindow,
9696
{
9797
embedded: true,
98+
menuIcon: 'more_horiz',
9899
modelValue: true,
99100
title: 'SSR Window',
100101
},
@@ -111,6 +112,7 @@ describe('QWindow exports', () => {
111112
expect(html).toContain('q-window')
112113
expect(html).toContain('role="region"')
113114
expect(html).toContain('aria-label="SSR Window"')
115+
expect(html).toContain('more_horiz')
114116
expect(html).toContain('SSR Window')
115117
expect(html).toContain('SSR window content')
116118
})

0 commit comments

Comments
 (0)