diff --git a/.vscode/settings.json b/.vscode/settings.json index 785fdef5a..28e93b249 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,4 +33,5 @@ "rust-analyzer.imports.granularity.group": "module", "rust-analyzer.imports.group.enable": false, "rust-analyzer.imports.prefix": "self" + "slint.preview.style": "fluent-dark" } diff --git a/gui/slint/main.slint b/gui/slint/main.slint index 5c2739131..95fa32acc 100644 --- a/gui/slint/main.slint +++ b/gui/slint/main.slint @@ -21,7 +21,6 @@ export component MainWindow inherits Window { pure callback open_new_issue_link(); - pure callback install_pkg(); pure callback open_system_folder(); pure callback quit(); diff --git a/gui/slint/main/menu.slint b/gui/slint/main/menu.slint index cfb3a342e..71bcdecee 100644 --- a/gui/slint/main/menu.slint +++ b/gui/slint/main/menu.slint @@ -1,4 +1,26 @@ -import { Button, StandardButton, AboutSlint } from "std-widgets.slint"; +import { Button, StandardButton, AboutSlint, HorizontalBox, Palette } from "std-widgets.slint"; + +component MenuItem inherits Rectangle { + background: Palette.background; + + in property title; + + Button { + text: title; + clicked => { submenu.show(); } + } + + submenu := PopupWindow { + x: parent.x + parent.width; + + VerticalLayout { + spacing: 0; + + @children + } + } +} + export component Menu { in property background; in property popup_width; @@ -9,22 +31,6 @@ export component Menu { pure callback quit(); pure callback open_new_issue_link(); pure callback open_system_folder(); - pure callback install_pkg(); - - install_pkg_dialog := PopupWindow { - width: popup_width; - height: popup_height; - x: popup_x; - y: popup_y; - - Dialog { - Text { - text: "This is a dialog box"; - } - StandardButton { kind: ok; } - StandardButton { kind: cancel; } - } - } about_dialog := PopupWindow { width: popup_width; @@ -32,7 +38,7 @@ export component Menu { x: popup_x; y: popup_y; - Rectangle { + Rectangle { Dialog { Text { text: "Obliteration is a free and open-source software for playing your PlayStation 4 titles on PC."; @@ -48,7 +54,7 @@ export component Menu { x: popup_x; y: popup_y; - Rectangle { + Rectangle { Dialog { AboutSlint {} StandardButton { kind: ok; } @@ -62,117 +68,60 @@ export component Menu { x: popup_x; y: popup_y; - Rectangle { + Rectangle { Text { text: "Obliteration is a free and open-source software for playing your PlayStation 4 titles on PC."; } } } - HorizontalLayout { + HorizontalBox { alignment: start; - spacing: 5px; - padding-left: 5px; - VerticalLayout { - TouchArea { - clicked => { files_popup.show(); } + Rectangle { + background: Palette.background; + + VerticalLayout { + alignment: start; + spacing: 0; - Rectangle { - Text { - text: "File"; + MenuItem { + title: "File"; + + Button { + text: "Open System Folder"; + clicked => { open_system_folder(); } } - } - } - - files_popup := PopupWindow { - y: parent.y + parent.height; - - Rectangle { - background: background; - - VerticalLayout { - spacing: 0px; - - Button { - text: "Install PKG"; - clicked => { install_pkg(); } - } - Button { - text: "Open System Folder"; - clicked => { open_system_folder(); } - } - Button { - text: "Quit"; - clicked => { quit() } - } + Button { + text: "Quit"; + clicked => { quit() } } } - } - } - VerticalLayout { - TouchArea { - clicked => { view_popup.show(); } + MenuItem { + title: "View"; - Rectangle { - Text { - text: "View"; - } - } - } - - view_popup := PopupWindow { - y: parent.y + parent.height; - - Rectangle { - background: background; - - VerticalLayout { - spacing: 0px; - - Button { - text: "Logs"; - clicked => { logs.show(); } - } + Button { + text: "Logs"; + clicked => { logs.show(); } } } - } - } - VerticalLayout { - TouchArea { - clicked => { help_popup.show(); } + MenuItem { + title: "Help"; - Rectangle { - Text { - text: "Help"; + Button { + text: "Report an Issue"; + clicked => { open_new_issue_link(); } } - } - } - - help_popup := PopupWindow { - y: parent.y + parent.height; - - Rectangle { - background: background; - - VerticalLayout { - spacing: 0px; - - Button { - text: "Report an Issue"; - clicked => { open_new_issue_link(); } - } - Button { - text: "About Slint"; - clicked => { about_slint.show(); } - } - Button { - text: "About Obliteration"; - clicked => { about_dialog.show(); } - } + Button { + text: "About Slint"; + clicked => { about_slint.show(); } + } + Button { + text: "About Obliteration"; + clicked => { about_dialog.show(); } } } } } } -} \ No newline at end of file +} diff --git a/gui/slint/main/tabs/cpu.slint b/gui/slint/main/tabs/cpu.slint index b1ef233ba..972f2ce4a 100644 --- a/gui/slint/main/tabs/cpu.slint +++ b/gui/slint/main/tabs/cpu.slint @@ -40,8 +40,7 @@ export component CpuTab { vertical-alignment: center; } LineEdit { - text: "127.0.0.1"; - max-height: 30px; + text: "127.0.0.1:1234"; } Button { text: "Start";