ditch the gnome titlebar (for now) as it doesn't work properly for me ;(

This commit is contained in:
Vivianne 2022-03-22 23:49:59 -07:00
parent 35b69747e8
commit 64ba90c802
4 changed files with 647 additions and 612 deletions

View file

@ -3,7 +3,6 @@
<interface>
<requires lib="gtk+" version="3.24"/>
<template class="DeskcandyDesktopWindow" parent="GtkWindow">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="resizable">False</property>

View file

@ -23,19 +23,21 @@ namespace Deskcandy {
}
this.socket = new Gtk.Socket();
this.socket.set_visible(true);
this.add(this.socket);
this.socket.visible = true;
this.visible = true;
try {
this.proc = candy.launch((uint)this.socket.get_id(), "abstractile");
this.proc = candy.launch((uint)this.socket.get_id(), "unknownpleasures");
} catch (Error e) {
error(e.message);
}
}
private void on_initialized(BaseCandy[] candies) {
this.present();
//this.refresh_socket(candy);
this.refresh_socket(candies[0]);
}
}
}

View file

@ -198,19 +198,9 @@
<column type="gchararray"/>
<!-- column-name description -->
<column type="gchararray"/>
<!-- column-name icon -->
<column type="GdkPixbuf"/>
<!-- column-name enabled -->
<column type="gboolean"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Cats</col>
<col id="1" translatable="yes">cats are cool creatures</col>
<col id="2">camera-video-symbolic</col>
<col id="3">True</col>
</row>
</data>
</object>
<object class="GtkListStore" id="screensavers_liststore">
<columns>
@ -221,13 +211,6 @@
<!-- column-name name -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Screen Saver 1</col>
<col id="1" translatable="yes">The alpha and the omega</col>
<col id="2" translatable="yes"/>
</row>
</data>
</object>
<object class="GtkFileFilter" id="video_file_filter">
<mime-types>
@ -236,15 +219,95 @@
</object>
<template class="DeskcandyWindow" parent="GtkApplicationWindow">
<property name="can-focus">False</property>
<property name="border-width">5</property>
<property name="window-position">center</property>
<property name="default-width">800</property>
<property name="default-height">500</property>
<property name="show-menubar">False</property>
<signal name="destroy" handler="on_window_destroy" swapped="no"/>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="border-width">5</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkMenuButton" id="open_menu_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">open-menu-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="candy_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cool Plasma is running</property>
<attributes>
<attribute name="style" value="italic"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="enabler_toggle">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="tooltip-text" translatable="yes">Start or stop the desktop effects</property>
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="action-name">app.toggle-enabled</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkPaned">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="border-width">0</property>
<property name="wide-handle">True</property>
<child>
<object class="GtkStack" id="main_stack">
@ -286,6 +349,9 @@
<property name="headers-clickable">False</property>
<property name="fixed-height-mode">True</property>
<property name="activate-on-single-click">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="sizing">fixed</property>
@ -295,7 +361,7 @@
<property name="radio">True</property>
</object>
<attributes>
<attribute name="active">3</attribute>
<attribute name="active">2</attribute>
</attributes>
</child>
</object>
@ -532,6 +598,9 @@
<property name="headers-clickable">False</property>
<property name="activate-on-single-click">True</property>
<signal name="row-activated" handler="on_screensaver_chooser_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="resizable">True</property>
@ -904,46 +973,13 @@
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="title" translatable="yes">GWinwrap</property>
<property name="subtitle" translatable="yes">Cool Plasma is running</property>
<property name="show-close-button">True</property>
<child>
<object class="GtkMenuButton" id="open_menu_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">open-menu-symbolic</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSwitch" id="enabler_toggle">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="tooltip-text" translatable="yes">Start or stop the desktop effects</property>
<property name="action-name">app.toggle-enabled</property>
</object>
<packing>
<property name="position">1</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</template>
<object class="GtkImage" id="video_icon">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">camera-video-symbolic</property>
</object>
</interface>

View file

@ -9,11 +9,11 @@ namespace Deskcandy {
[GtkChild]
private unowned Gtk.MenuButton open_menu_button;
[GtkChild]
private unowned Gtk.Box preview;
[GtkChild]
private unowned Gtk.HeaderBar headerbar;
private unowned Gtk.Bin preview;
[GtkChild]
private unowned Gtk.Stack main_stack;
[GtkChild]
private unowned Gtk.Label candy_status;
[GtkChild]
private unowned Gtk.ListStore screensavers_liststore;
@ -64,10 +64,8 @@ namespace Deskcandy {
}
this.socket = new Gtk.Socket();
this.socket.expand = true;
this.preview.add(this.socket);
this.socket.visible = true;
this.socket.realize();
this.preview.add(this.socket);
try {
this.proc = candy.launch((uint)this.socket.get_id(), name);
@ -120,7 +118,7 @@ namespace Deskcandy {
private void on_notify_enabled(Object o, GLib.ParamSpec param) {
var val = ((Application)o).enabled;
this.headerbar.subtitle = val ? "started" : "stopped";
this.candy_status.label = val ? "Candy started" : "Candy stopped";
}
}
}