Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
f6c7ab20
Commit
f6c7ab20
authored
May 16, 2017
by
Sylvain Berfini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked menu bar to use burger
parent
48c0678b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
149 deletions
+68
-149
MainWindow.qml
linphone-desktop/ui/views/App/Main/MainWindow.qml
+16
-2
MainWindowMenuBar.qml
linphone-desktop/ui/views/App/Main/MainWindowMenuBar.qml
+52
-147
No files found.
linphone-desktop/ui/views/App/Main/MainWindow.qml
View file @
f6c7ab20
...
...
@@ -47,9 +47,9 @@ ApplicationWindow {
// Menu bar.
// ---------------------------------------------------------------------------
menuBar
:
MainWindowMenuBar
{
/*
menuBar: MainWindowMenuBar {
hide: mainLoader.item ? !mainLoader.item.collapse.isCollapsed : true
}
}
*/
// ---------------------------------------------------------------------------
...
...
@@ -184,6 +184,20 @@ ApplicationWindow {
visible
:
!
smartSearchBar
.
isOpen
}
}
Icon
{
icon
:
'
burger_menu_normal
'
iconSize
:
16
MainWindowMenuBar
{
id
:
mainmenu
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
mainmenu
.
open
()
}
}
}
}
...
...
linphone-desktop/ui/views/App/Main/MainWindowMenuBar.qml
View file @
f6c7ab20
import
QtQuick
2.7
import
QtQuick
.
Controls
1.4
import
QtQuick
.
Controls
2.1
import
QtQuick
.
Controls
.
Styles
1.4
import
QtQuick
.
Window
2.2
import
Qt
.
labs
.
platform
1.0
import
Linphone
1.0
...
...
@@ -9,175 +10,79 @@ import App.Styles 1.0
// =============================================================================
MenuBar
{
id
:
container
// ---------------------------------------------------------------------------
property
bool
hide
:
false
// ---------------------------------------------------------------------------
// Workaround to hide toolbar.
// Use private properties of MenuBar.
__contentItem.height
:
hide
?
0
:
MainWindowMenuBarStyle
.
height
__contentItem.transform
:
Scale
{
yScale
:
Number
(
!
hide
)
Item
{
function
open
()
{
menu
.
open
()
}
// ---------------------------------------------------------------------------
style
:
MenuBarStyle
{
background
:
Rectangle
{
color
:
MainWindowMenuBarStyle
.
color
Rectangle
{
anchors.bottom
:
parent
.
bottom
color
:
MainWindowMenuBarStyle
.
separator
.
color
height
:
MainWindowMenuBarStyle
.
separator
.
height
width
:
parent
.
width
Menu
{
id
:
menu
Menu
{
title
:
qsTr
(
'
options
'
)
MenuItem
{
shortcut
:
'
Ctrl+P
'
text
:
qsTr
(
'
settings
'
)
onTriggered
:
{
var
window
=
App
.
getSettingsWindow
()
if
(
window
.
visibility
===
Window
.
Minimized
)
{
window
.
visibility
=
Window
.
AutomaticVisibility
}
else
{
window
.
setVisible
(
true
)
}
}
}
}
menuStyle
:
MenuStyle
{
id
:
menuStyle
font.pointSize
:
MainWindowMenuBarStyle
.
subMenu
.
text
.
fontSize
MenuSeparator
{}
frame
:
Item
{}
MenuItem
{
shortcut
:
StandardKey
.
Quit
text
:
qsTr
(
'
quit
'
)
itemDelegate
{
background
:
Rectangle
{
color
:
(
styleData
.
selected
||
styleData
.
open
)
?
MainWindowMenuBarStyle
.
subMenu
.
color
.
selected
:
MainWindowMenuBarStyle
.
subMenu
.
color
.
normal
}
label
:
Label
{
color
:
styleData
.
selected
?
MainWindowMenuBarStyle
.
subMenu
.
text
.
color
.
selected
:
MainWindowMenuBarStyle
.
subMenu
.
text
.
color
.
normal
font
:
menuStyle
.
font
text
:
styleData
.
text
}
shortcut
:
Label
{
color
:
styleData
.
selected
?
MainWindowMenuBarStyle
.
subMenu
.
text
.
color
.
selected
:
MainWindowMenuBarStyle
.
subMenu
.
text
.
color
.
normal
font
:
menuStyle
.
font
text
:
styleData
.
shortcut
}
onTriggered
:
Qt
.
quit
()
}
}
itemDelegate
:
Item
{
implicitHeight
:
menuItem
.
height
+
MainWindowMenuBarStyle
.
separator
.
spacing
implicitWidth
:
menuItem
.
width
Item
{
id
:
menuItem
// ---------------------------------------------------------------------------
// Tools.
// ---------------------------------------------------------------------------
implicitHeight
:
text
.
height
+
MainWindowMenuBarStyle
.
menu
.
text
.
verticalMargins
*
2
implicitWidth
:
text
.
width
+
MainWindowMenuBarStyle
.
menu
.
text
.
horizontalMargins
*
2
Menu
{
title
:
qsTr
(
'
tools
'
)
Text
{
id
:
text
MenuItem
{
text
:
qsTr
(
'
audioAssistant
'
)
anchors.centerIn
:
parent
color
:
styleData
.
open
?
MainWindowMenuBarStyle
.
menu
.
text
.
color
.
selected
:
MainWindowMenuBarStyle
.
menu
.
text
.
color
.
normal
font.pointSize
:
MainWindowMenuBarStyle
.
menu
.
text
.
fontSize
text
:
formatMnemonic
(
styleData
.
text
,
styleData
.
underlineMnemonic
)
}
Rectangle
{
anchors.bottom
:
parent
.
bottom
color
:
MainWindowMenuBarStyle
.
menu
.
indicator
.
color
visible
:
styleData
.
open
height
:
MainWindowMenuBarStyle
.
menu
.
indicator
.
height
width
:
parent
.
width
}
onTriggered
:
console
.
log
(
'
TODO
'
)
}
}
}
// ---------------------------------------------------------------------------
// Options.
// ---------------------------------------------------------------------------
Menu
{
// ---------------------------------------------------------------------------
// Help.
// ---------------------------------------------------------------------------
title
:
qsTr
(
'
options
'
)
Menu
{
title
:
qsTr
(
'
help
'
)
MenuItem
{
shortcut
:
'
Ctrl+P
'
text
:
qsTr
(
'
settings
'
)
MenuItem
{
shortcut
:
StandardKey
.
HelpContents
text
:
qsTr
(
'
about
'
)
onTriggered
:
{
var
window
=
App
.
getSettingsWindow
()
if
(
window
.
visibility
===
Window
.
Minimized
)
{
window
.
visibility
=
Window
.
AutomaticVisibility
}
else
{
window
.
setVisible
(
true
)
onTriggered
:
{
window
.
detachVirtualWindow
()
window
.
attachVirtualWindow
(
Qt
.
resolvedUrl
(
'
About.qml
'
))
}
}
}
MenuSeparator
{}
MenuItem
{
shortcut
:
StandardKey
.
Quit
text
:
qsTr
(
'
quit
'
)
onTriggered
:
Qt
.
quit
()
}
}
// ---------------------------------------------------------------------------
// Tools.
// ---------------------------------------------------------------------------
Menu
{
title
:
qsTr
(
'
tools
'
)
MenuItem
{
text
:
qsTr
(
'
audioAssistant
'
)
onTriggered
:
console
.
log
(
'
TODO
'
)
}
}
// ---------------------------------------------------------------------------
// Help.
// ---------------------------------------------------------------------------
MenuSeparator
{}
Menu
{
title
:
qsTr
(
'
help
'
)
MenuItem
{
text
:
qsTr
(
'
checkForUpdates
'
)
MenuItem
{
shortcut
:
StandardKey
.
HelpContents
text
:
qsTr
(
'
about
'
)
onTriggered
:
{
window
.
detachVirtualWindow
()
window
.
attachVirtualWindow
(
Qt
.
resolvedUrl
(
'
About.qml
'
))
onTriggered
:
console
.
log
(
'
TODO
'
)
}
}
MenuSeparator
{}
MenuItem
{
text
:
qsTr
(
'
checkForUpdates
'
)
onTriggered
:
console
.
log
(
'
TODO
'
)
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment