gtk2/gtk/ui/gtkfontchooserdialog.ui
Matthias Clasen 15f8b2d0ae font chooser: Add a tweak page
Add a button the dialog's header bar that lets us
switch to a second page where we can customize
the selected font.

Make the font chooser widget export an action that the
dialog can use for the button. This has some advantages:
- we can export not just the toggle state, but also enabled
- we can reuse the same enabled state to make the select
  button insensitive when no font is selected

To determine whether a font is selected, listen to changes
of the list selection. And ensure that the font chooser is
in an initial state when mapped, even if we close the dialog
from the tweak page.
2018-01-03 12:18:18 -05:00

42 lines
1.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<!-- interface-requires gtk+ 3.10 -->
<template class="GtkFontChooserDialog" parent="GtkDialog">
<property name="title" translatable="yes">Select Font</property>
<property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="margin">5</property>
<child>
<object class="GtkFontChooserWidget" id="fontchooser">
<property name="vexpand">1</property>
<signal name="font-activated" handler="font_activated_cb" swapped="no"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">1</property>
<property name="label" translatable="yes">_Cancel</property>
</object>
</child>
<child type="action">
<object class="GtkButton" id="select_button">
<property name="label" translatable="yes">_Select</property>
<property name="use-underline">1</property>
<property name="can-default">1</property>
</object>
</child>
<action-widgets>
<action-widget response="cancel">cancel_button</action-widget>
<action-widget response="ok" default="true">select_button</action-widget>
</action-widgets>
</template>
</interface>