Window: add HdyColumn

This commit is contained in:
Julian Sparber
2019-10-08 16:19:42 +02:00
parent 6c1f07d8a5
commit 3610dff0b6
5 changed files with 239 additions and 208 deletions

View File

@@ -18,6 +18,8 @@
#include <gtk/gtk.h>
#include <string.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
#include "teleport-app.h"
#include "teleport-window.h"
@@ -122,6 +124,7 @@ teleport_window_init (TeleportWindow *win)
priv = teleport_window_get_instance_private (win);
g_type_ensure (HDY_TYPE_COLUMN);
gtk_widget_init_template (GTK_WIDGET (win));
builder = gtk_builder_new_from_resource ("/com/frac_tion/teleport/settings.ui");

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.8 -->
<requires lib="libhandy" version="0.0"/>
<template class="TeleportWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Teleport</property>
<property name="default_width">650</property>
@@ -27,135 +28,140 @@
<property name="shadow_type">none</property>
<property name="hscrollbar_policy">never</property>
<child>
<object class="GtkBox" id="general-container">
<object class="HdyColumn">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="margin_left">24</property>
<property name="margin_right">24</property>
<property name="orientation">vertical</property>
<property name="width-request">500</property>
<property name="linear-growth-width">600</property>
<property name="maximum-width">600</property>
<child>
<object class="GtkFrame" id="general-frame">
<object class="GtkBox" id="general-container">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">in</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="shadow_type">none</property>
<child type="label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="this-device-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">This device</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_top">6</property>
<property name="label" translatable="yes">How your device appears to others</property>
<style>
<class name="dim-label"/>
</style>
<attributes>
<attribute name="scale" value="0.9"/>
</attributes>
</object>
</child>
</object>
</child>
<property name="margin_left">24</property>
<property name="margin_right">24</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame" id="general-frame-listbox">
<object class="GtkFrame" id="general-frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkListBox" id="this-device-listbox">
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="shadow_type">none</property>
<child type="label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkListBoxRow" id="this-device-row">
<object class="GtkLabel" id="this-device-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="activatable">false</property>
<property name="halign">start</property>
<property name="label" translatable="yes">This device</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_top">6</property>
<property name="label" translatable="yes">How your device appears to others</property>
<style>
<class name="dim-label"/>
</style>
<attributes>
<attribute name="scale" value="0.9"/>
</attributes>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame" id="general-frame-listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkListBox" id="this-device-listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<child>
<object class="GtkGrid" id="this-device-grid">
<object class="GtkListBoxRow" id="this-device-row">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">0</property>
<property name="column_spacing">16</property>
<property name="margin">12</property>
<property name="margin_start">16</property>
<property name="activatable">false</property>
<child>
<object class="GtkLabel" id="this_device_name_label">
<object class="GtkGrid" id="this-device-grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="expand">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Angela's Thinkpad</property>
<property name="use_underline">True</property>
<style>
<class name="device-name"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="column_homogeneous">True</property>
<style>
<class name="linked"/>
</style>
<property name="row_spacing">0</property>
<property name="column_spacing">16</property>
<property name="margin">12</property>
<property name="margin_start">16</property>
<child>
<object class="GtkMenuButton" id="this_device_settings_button">
<object class="GtkLabel" id="this_device_name_label">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use-popover">True</property>
<property name="height_request">35</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">document-edit-symbolic</property>
</object>
</child>
<property name="can_focus">False</property>
<property name="expand">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Angela's Thinkpad</property>
<property name="use_underline">True</property>
<style>
<class name="image-button"/>
<class name="device-name"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="column_homogeneous">True</property>
<style>
<class name="linked"/>
</style>
<child>
<object class="GtkMenuButton" id="this_device_settings_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use-popover">True</property>
<property name="height_request">35</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">document-edit-symbolic</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
</object>
</child>
@@ -165,101 +171,100 @@
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame" id="remote-devices-frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="shadow_type">none</property>
<property name="label_yalign">0.45</property>
<child type="label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="remote-devices-network-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Other devices on the local network</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_top">6</property>
<property name="label" translatable="yes">Drag and drop files on devices to send them</property>
<style>
<class name="dim-label"/>
</style>
<attributes>
<attribute name="scale" value="0.9"/>
</attributes>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="remote_devices_box">
<object class="GtkFrame" id="remote-devices-frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="margin_top">6</property>
<property name="orientation">vertical</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="shadow_type">none</property>
<property name="label_yalign">0.45</property>
<child type="label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="remote-devices-network-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Other devices on the local network</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_top">6</property>
<property name="label" translatable="yes">Drag and drop files on devices to send them</property>
<style>
<class name="dim-label"/>
</style>
<attributes>
<attribute name="scale" value="0.9"/>
</attributes>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame" id="remote_no_avahi">
<object class="GtkBox" id="remote_devices_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">in</property>
<property name="spacing">6</property>
<property name="margin_top">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkListBox">
<object class="GtkFrame" id="remote_no_avahi">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="selection_mode">none</property>
<property name="can_focus">False</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkListBoxRow">
<object class="GtkListBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="activatable">False</property>
<property name="selectable">False</property>
<property name="can_focus">True</property>
<property name="selection_mode">none</property>
<child>
<object class="GtkAlignment">
<object class="GtkListBoxRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">50</property>
<property name="bottom_padding">50</property>
<property name="activatable">False</property>
<property name="selectable">False</property>
<child>
<object class="GtkBox">
<object class="GtkAlignment">
<property name="visible">True</property>
<property name="spacing">20</property>
<property name="orientation">vertical</property>
<property name="can_focus">False</property>
<property name="top_padding">50</property>
<property name="bottom_padding">50</property>
<child>
<object class="GtkLabel">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="max-width-chars">40</property>
<property name="halign">center</property>
<property name="wrap">True</property>
<property name="justify">center</property>
<property name="label">The Avahi daemon is not running. You can run this command to start it now:</property>
</object>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="editable">False</property>
<property name="width-request">206</property>
<property name="text">systemctl start avahi-daemon</property>
<property name="spacing">20</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="max-width-chars">40</property>
<property name="halign">center</property>
<property name="wrap">True</property>
<property name="justify">center</property>
<property name="label">The Avahi daemon is not running. You can run this command to start it now:</property>
</object>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="editable">False</property>
<property name="text">systemctl start avahi-daemon</property>
</object>
</child>
</object>
</child>
</object>
@@ -270,46 +275,46 @@
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame" id="remote_no_devices">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkListBox">
<object class="GtkFrame" id="remote_no_devices">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="selection_mode">none</property>
<property name="can_focus">False</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkListBoxRow">
<object class="GtkListBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="activatable">False</property>
<property name="selectable">False</property>
<property name="can_focus">True</property>
<property name="selection_mode">none</property>
<child>
<object class="GtkAlignment">
<object class="GtkListBoxRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">50</property>
<property name="bottom_padding">50</property>
<property name="activatable">False</property>
<property name="selectable">False</property>
<child>
<object class="GtkBox">
<object class="GtkAlignment">
<property name="visible">True</property>
<property name="spacing">20</property>
<property name="orientation">vertical</property>
<property name="can_focus">False</property>
<property name="top_padding">50</property>
<property name="bottom_padding">50</property>
<child>
<object class="GtkLabel">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">Searching for other devices...</property>
</object>
</child>
<child>
<object class="GtkSpinner">
<property name="visible">True</property>
<property name="active">True</property>
<property name="spacing">20</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">Searching for other devices...</property>
</object>
</child>
<child>
<object class="GtkSpinner">
<property name="visible">True</property>
<property name="active">True</property>
</object>
</child>
</object>
</child>
</object>
@@ -324,6 +329,7 @@
</child>
</object>
</child>
</object>
</child>
</object>