Commit 0ada3935 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

window: use hdyApplicationWindow

parent ec52bbaa
Pipeline #195820 failed with stage
in 1 minute and 29 seconds
......@@ -6,7 +6,7 @@
<property name="can_focus">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<property name="program_name" translatable="yes">@name-prefix@Icon Library</property>
<property name="program_name" translatable="yes">Icon Library</property>
<property name="version">@version@</property>
<property name="website">https://gitlab.gnome.org/World/design/icon-library</property>
<property name="authors">Bilal Elmoussaoui</property>
......
......@@ -5,17 +5,13 @@
<requires lib="libhandy" version="0.0"/>
<object class="GtkStack" id="icons_view">
<property name="visible">True</property>
<property name="expand">True</property>
<property name="can_focus">False</property>
<property name="transition_type">crossfade</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="HdyClamp">
<property name="visible">True</property>
......@@ -121,8 +117,6 @@
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="name">results</property>
</packing>
......@@ -170,7 +164,6 @@
</object>
<packing>
<property name="name">no-results</property>
<property name="position">1</property>
</packing>
</child>
</object>
......
......@@ -46,13 +46,17 @@
</packing>
</child>
</object>
<object class="GtkApplicationWindow" id="window">
<object class="HdyApplicationWindow" id="window">
<property name="can_focus">False</property>
<property name="default_width">650</property>
<property name="default_height">500</property>
<property name="icon_name">@app-id@</property>
<property name="title" translatable="yes">@name-prefix@Icon Library</property>
<child type="titlebar">
<property name="title" translatable="yes">Icon Library</property>
<child>
<object class="GtkBox" id="container">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -118,4 +122,6 @@
</object>
</child>
</object>
</child>
</object>
</interface>
......@@ -12,13 +12,13 @@ use std::{cell::RefCell, rc::Rc};
#[derive(Clone)]
pub struct SearchProvider {
search_provider: Arc<SP>,
window: gtk::ApplicationWindow,
window: libhandy::ApplicationWindow,
sender: Sender<Action>,
model: Rc<IconsModel>,
}
impl SearchProvider {
pub fn new(model: Rc<IconsModel>, window: gtk::ApplicationWindow, sender: Sender<Action>) -> Rc<RefCell<Self>> {
pub fn new(model: Rc<IconsModel>, window: libhandy::ApplicationWindow, sender: Sender<Action>) -> Rc<RefCell<Self>> {
let search_provider = SP::new(APP_ID.to_string(), "/org/gnome/design/IconLibrary/SearchProvider".to_string());
let sp = Rc::new(RefCell::new(Self {
......
......@@ -7,7 +7,7 @@ use gtk::prelude::*;
use std::rc::Rc;
pub struct Window {
pub widget: gtk::ApplicationWindow,
pub widget: libhandy::ApplicationWindow,
builder: gtk::Builder,
sender: glib::Sender<Action>,
pub model: Rc<IconsModel>,
......@@ -17,7 +17,7 @@ impl Window {
pub fn new(sender: glib::Sender<Action>, model: Rc<IconsModel>) -> Self {
let settings = gio::Settings::new(APP_ID);
let builder = gtk::Builder::from_resource("/org/gnome/design/IconLibrary/window.ui");
get_widget!(builder, gtk::ApplicationWindow, window);
get_widget!(builder, libhandy::ApplicationWindow, window);
let window_widget = Window {
widget: window,
......@@ -67,7 +67,8 @@ impl Window {
for (_, icons_context) in self.model.shipped_icons.borrow().iter() {
icons_view.add_context(icons_context.clone());
}
self.widget.add(&icons_view.widget);
get_widget!(self.builder, gtk::Box, container);
container.add(&icons_view.widget);
// Search
get_widget!(self.builder, gtk::SearchEntry, search_entry);
......
......@@ -3,7 +3,7 @@ use gio::prelude::SettingsExt;
use gtk::prelude::GtkWindowExt;
use gtk::SettingsExt as gtkSettingsExt;
pub fn load(window: &gtk::ApplicationWindow, settings: &gio::Settings) {
pub fn load(window: &libhandy::ApplicationWindow, settings: &gio::Settings) {
let width = settings.get_int("window-width");
let height = settings.get_int("window-height");
......@@ -28,7 +28,7 @@ pub fn load(window: &gtk::ApplicationWindow, settings: &gio::Settings) {
}
}
pub fn save(window: &gtk::ApplicationWindow, settings: &gio::Settings) -> Result<()> {
pub fn save(window: &libhandy::ApplicationWindow, settings: &gio::Settings) -> Result<()> {
let size = window.get_size();
let position = window.get_position();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment