focus on your browsing
browser web-browser

use new header bar style (which should fix slight webview glitches)

add support for left window controls
readd menu button

woof.monster 109c92ac 1b88a690

verified
+45 -23
+4
OuchBrowser/Styles.css
··· 41 41 min-width: 24px; 42 42 padding: 0; 43 43 } 44 + 45 + .top-bar { 46 + background: hsl(from var(--window-bg-color) h s l / 0.95); 47 + }
+8 -1
OuchBrowser/UI.cs
··· 27 27 [Connect] public readonly Button? go_back; 28 28 [Connect] public readonly Button? go_forward; 29 29 [Connect] public readonly Button? refresh; 30 + [Connect] public readonly WindowControls? left_controls; 30 31 31 32 public Window(Adw.Application app) : base() 32 33 { ··· 55 56 56 57 AddBreakpoint(SetupBreakpoint()); 57 58 59 + left_controls!.SetVisible(!left_controls!.GetEmpty()); 60 + left_controls!.OnNotify += (_, args) => 61 + { 62 + if (args.Pspec.GetName() == "empty") left_controls!.SetVisible(!left_controls!.GetEmpty()); 63 + }; 64 + 58 65 Maximized = settings.GetBoolean("maximized"); 59 66 DefaultWidth = 1000; 60 67 DefaultHeight = 600; ··· 67 74 { 68 75 controller.OnEnter += (_, _) => 69 76 { 70 - content_toolbar!.SetRevealTopBars(true); 77 + content_toolbar!.SetRevealTopBars(!(left_controls!.GetEmpty() == false && osv!.GetShowSidebar() == true)); 71 78 }; 72 79 controller.OnLeave += (_, _) => 73 80 {
+33 -22
OuchBrowser/UI/Builder/Window.blp
··· 20 20 CenterBox { 21 21 margin-top: 6; 22 22 margin-start: 6; 23 + margin-bottom: 6; 23 24 24 25 start-widget: Box { 25 26 orientation: horizontal; 26 - // spacing: 5; 27 - // TODO: support window controls on the left 28 - // side 29 - 30 - /* WindowControls { 27 + spacing: 6; 28 + 29 + WindowControls left_controls { 31 30 side: start; 32 - } */ 31 + } 32 + 33 + MenuButton { 34 + icon-name: "site.srht.shrimple.OuchBrowser-symbolic"; 35 + tooltip-text: _("Menu"); 36 + menu-model: main_menu; 37 + 38 + styles [ 39 + "flat", 40 + ] 41 + } 42 + 33 43 ToggleButton sidebar_toggle { 34 44 active: true; 35 45 icon-name: "sidebar-show-symbolic"; 36 46 tooltip-text: _("Hide Sidebar"); 37 47 sensitive: false; 48 + margin-end: 6; 38 49 39 50 styles [ 40 51 "flat", ··· 105 116 106 117 Label hostname { 107 118 label: ""; 108 - margin-start: 6; 109 - margin-end: 6; 110 119 ellipsize: end; 111 120 tooltip-text: _("Reveal Command Palette"); 112 121 ··· 302 311 Adw.ToolbarView content_toolbar { 303 312 reveal-top-bars: false; 304 313 reveal-bottom-bars: bind osv.collapsed; 314 + top-bar-style: raised; 315 + extend-content-to-top-edge: true; 305 316 306 317 [top] 307 318 Adw.HeaderBar content_headerbar { ··· 556 567 item (_("History")) 557 568 item (_("Downloads")) 558 569 } 570 + } 559 571 572 + menu new_menu { 560 573 section { 561 - item (_("Show All Tabs"), "overview.open") 574 + label: _("New…"); 575 + item (_("New Room")) 576 + item (_("New Folder")) 562 577 } 563 578 564 579 section { 565 - submenu { 566 - label: _("More"); 567 - item (_("Preferences"), "win.preferences") 568 - item (_("Plugins Manager")) 569 - 570 - section { 571 - item (_("About Ouch Browser"), "win.about") 572 - } 573 - } 580 + item (_("New Tab"), "win.palette-new") 574 581 } 575 582 } 576 583 577 - menu new_menu { 584 + menu main_menu { 578 585 section { 579 - item (_("New Room")) 580 - item (_("New Folder")) 586 + item (_("Show All Tabs"), "overview.open") 581 587 } 582 588 583 589 section { 584 - item (_("New Tab"), "win.palette-new") 590 + item (_("Preferences"), "win.preferences") 591 + item (_("Plugins Manager")) 592 + 593 + section { 594 + item (_("About Ouch Browser"), "win.about") 595 + } 585 596 } 586 597 }