Use responsive design

This commit is contained in:
Angelo Verlain Shema 2023-10-10 18:16:23 +00:00 committed by Tom Wagner
parent 903df21ba3
commit e1f63ddd28
4 changed files with 59 additions and 27 deletions

View file

@ -53,3 +53,20 @@ port-handle {
border-radius: 50%;
background-color: @media-type-unknown;
}
button.rounded {
padding: 6px;
border-radius: 9999px;
}
entry.rounded {
border-radius: 9999px;
}
entry.rounded > :first-child {
padding-left: 12px;
}
entry.rounded > :nth-child(2) {
padding-right: 12px;
}

View file

@ -34,6 +34,7 @@ mod imp {
menu.append(Some("200%"), Some("win.set-zoom(2.0)"));
menu.append(Some("300%"), Some("win.set-zoom(3.0)"));
let popover = gtk::PopoverMenu::from_model(Some(&menu));
popover.set_position(gtk::PositionType::Top);
ZoomEntry {
graphview: Default::default(),

View file

@ -1,26 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="HelvumZoomEntry" parent="GtkBox">
<child>
<object class="GtkButton" id="zoom_out_button">
<property name="icon-name">zoom-out-symbolic</property>
<property name="tooltip-text">Zoom out</property>
</object>
</child>
<property name="spacing">12</property>
<child>
<object class="GtkEntry" id="entry">
<property name="secondary-icon-name">go-down-symbolic</property>
<property name="input-purpose">digits</property>
<property name="max-width-chars">5</property>
<style>
<class name="osd"/>
<class name="rounded"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="zoom_out_button">
<property name="icon-name">zoom-out-symbolic</property>
<property name="tooltip-text">Zoom out</property>
<style>
<class name="osd"/>
<class name="rounded"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="zoom_in_button">
<property name="icon-name">zoom-in-symbolic</property>
<property name="tooltip-text">Zoom in</property>
<style>
<class name="osd"/>
<class name="rounded"/>
</style>
</object>
</child>
<style>
<class name="linked"/>
</style>
</template>
</interface>
</interface>

View file

@ -20,19 +20,9 @@
<child>
<object class="AdwHeaderBar" id="header_bar">
<child type="end">
<object class="GtkBox">
<property name="spacing">6</property>
<child>
<object class="HelvumZoomEntry">
<property name="zoomed-widget">graph</property>
</object>
</child>
<child>
<object class="GtkMenuButton">
<property name="icon-name">open-menu-symbolic</property>
<property name="menu-model">primary_menu</property>
</object>
</child>
<object class="GtkMenuButton">
<property name="icon-name">open-menu-symbolic</property>
<property name="menu-model">primary_menu</property>
</object>
</child>
</object>
@ -44,11 +34,24 @@
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<object class="GtkOverlay">
<child>
<object class="HelvumGraphView" id="graph">
<property name="hexpand">true</property>
<property name="vexpand">true</property>
<object class="GtkScrolledWindow">
<child>
<object class="HelvumGraphView" id="graph">
<property name="hexpand">true</property>
<property name="vexpand">true</property>
</object>
</child>
</object>
</child>
<child type="overlay">
<object class="HelvumZoomEntry">
<property name="zoomed-widget">graph</property>
<property name="halign">end</property>
<property name="valign">end</property>
<property name="margin-end">24</property>
<property name="margin-bottom">24</property>
</object>
</child>
</object>