Add support for GTK 4 (#3916)

* Make compact mode switch work for both GTK 3 and 4

* Implement GTK 4-specific view gesture handling

* Fix torrents view context menu on GTK 4

* Explicitly show/hide menubar on startup/teardown

* Switch from `Gtk::Pixbuf` to `Gio::Icon` for views

* Support GTK 4 exceptions based on `std::exception`

* Fix options menu setup with GTK 4

* Use `delete-event` (GTK 3) and `close-request` (GTK 4) signals to handle window clousure

* Add custom file chooser button implementation

GTK 4 drops FileChooserButton widget and suggests implementing it using
Button.

* Add helpers to set X11 hints with GTK 4

* Remove `HigWorkarea` class that's no longer used

* Make main menu shortcuts work with GTK 4

* Make drops work in main window and make dialog with GTK 4

* Remove unused `gtr_action_get_widget()` helper

* Fix text direction mark setup with GTK 4 (due to switch to enum class)

* Fix file tree font size calculation with GTK 4

* Fix crash during shutdown with GTK 4

* Switch from `RadioButton` to `CheckButton` for compatibility with GTK 4

* Fix opening files with GTK 4

* Rework torrent cell renderer to support both GTK 3 and 4

* Disable system tray icon support with GTK 4

* Fix windows positioning with GTK 4

* Fix focus event handling with GTK 4

* Adapt to tree model row/iterator changes in GTK 4

* Adapt to toplevel/root window changes in GTK 4

* Adapt to clipboard changes in GTK 4

* Adapt to icon/theme changes in GTK 4

* Adapt to file/path changes in GTK 4

* Random leftover fixes for GTK 4 compatibility

* Clean up unused code

* Move GTK 3 *.ui files into a subdirectory

* Add GTK 4 *.ui files

* Search for both GTK 3 and 4 during configuration
This commit is contained in:
Mike Gelfand
2022-10-08 15:50:03 -07:00
committed by GitHub
parent e3b871216f
commit c75c6bf5c8
63 changed files with 6329 additions and 849 deletions

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="transmission-gtk">
<requires lib="gtk" version="4.0"/>
<object class="GtkWindow" id="MessageLogWindow">
<property name="title" translatable="1">Message Log</property>
<property name="default-width">560</property>
<property name="default-height">350</property>
<property name="child">
<object class="GtkBox" id="window_layout">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="toolbar">
<property name="valign">center</property>
<property name="css-classes">toolbar
horizontal</property>
<child>
<object class="GtkButton" id="save_as_button">
<property name="action-name">win.save-message-log</property>
<child>
<object class="GtkBox">
<property name="halign">center</property>
<property name="spacing">5</property>
<child>
<object class="GtkImage">
<property name="icon-name">document-save-as</property>
<property name="icon_size">normal</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Save _As</property>
<property name="single-line-mode">1</property>
<property name="use-underline">1</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="clear_button">
<property name="action-name">win.clear-message-log</property>
<child>
<object class="GtkBox">
<property name="halign">center</property>
<property name="spacing">5</property>
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear</property>
<property name="icon_size">normal</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Clear</property>
<property name="single-line-mode">1</property>
<property name="use-underline">1</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparator">
<property name="orientation">vertical</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="pause_button">
<property name="action-name">win.pause-message-log</property>
<child>
<object class="GtkBox">
<property name="halign">center</property>
<property name="spacing">5</property>
<child>
<object class="GtkImage">
<property name="icon-name">media-playback-pause</property>
<property name="icon_size">normal</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">P_ause</property>
<property name="single-line-mode">1</property>
<property name="use-underline">1</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparator">
<property name="orientation">vertical</property>
</object>
</child>
<child>
<object class="GtkLabel" id="level_label">
<property name="label" translatable="1">Level</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">level_combo</property>
<property name="css-classes">tr-pad-normal</property>
</object>
</child>
<child>
<object class="GtkComboBox" id="level_combo">
<child>
<object class="GtkCellRendererText" id="level_combo_renderer"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow" id="messages_view_scroll">
<property name="vexpand">1</property>
<property name="focusable">1</property>
<property name="has-frame">1</property>
<property name="child">
<object class="GtkTreeView" id="messages_view">
<property name="focusable">1</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="messages_view_selection"/>
</child>
</object>
</property>
<style>
<class name="tr-message-log"/>
</style>
</object>
</child>
</object>
</property>
</object>
</interface>