revert X Property change, and cleanup formatting

This commit is contained in:
Ashley Wulber 2021-12-29 17:31:01 -05:00
parent 5a4a802751
commit 65f43a9300
32 changed files with 459 additions and 429 deletions

View file

@ -1,61 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="SearchResultRow" parent="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">12</property>
<property name="margin-start">4</property>
<property name="margin-end">4</property>
<property name="hexpand">true</property>
<child>
<object class="GtkImage" id="categoryimage">
<property name="pixel-size">20</property>
</object>
</child>
<child>
<object class="GtkImage" id="image">
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="pixel-size">36</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="halign">fill</property>
<property name="hexpand">true</property>
<property name="margin-top">4</property>
<template class="SearchResultRow" parent="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">12</property>
<property name="margin-start">4</property>
<property name="margin-end">4</property>
<property name="margin-bottom">4</property>
<property name="hexpand">true</property>
<child>
<object class="GtkLabel" id="name">
<property name="halign">start</property>
<property name="ellipsize">end</property>
<property name="max-width-chars">40</property>
<style>
<class name="title-4" />
</style>
</object>
<object class="GtkImage" id="categoryimage">
<property name="pixel-size">20</property>
</object>
</child>
<child>
<object class="GtkLabel" id="description">
<property name="halign">start</property>
<property name="ellipsize">end</property>
<property name="max-width-chars">50</property>
<style>
<class name="body" />
</style>
</object>
<object class="GtkImage" id="image">
<property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="pixel-size">36</property>
</object>
</child>
</object>
</child>
<child type="end">
<object class="GtkLabel" id="shortcut">
<property name="halign">end</property>
<property name="wrap">false</property>
<style>
<class name="body" />
</style>
</object>
</child>
</template>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="halign">fill</property>
<property name="hexpand">true</property>
<property name="margin-top">4</property>
<property name="margin-end">4</property>
<property name="margin-bottom">4</property>
<child>
<object class="GtkLabel" id="name">
<property name="halign">start</property>
<property name="ellipsize">end</property>
<property name="max-width-chars">40</property>
<style>
<class name="title-4"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="description">
<property name="halign">start</property>
<property name="ellipsize">end</property>
<property name="max-width-chars">50</property>
<style>
<class name="body"/>
</style>
</object>
</child>
</object>
</child>
<child type="end">
<object class="GtkLabel" id="shortcut">
<property name="halign">end</property>
<property name="wrap">false</property>
<style>
<class name="body"/>
</style>
</object>
</child>
</template>
</interface>

View file

@ -1,9 +1,8 @@
use gtk4 as gtk;
use gtk::CompositeTemplate;
use gtk::glib;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk4 as gtk;
use gtk::CompositeTemplate;
#[derive(Debug, Default, CompositeTemplate)]
#[template(file = "application_row.ui")]
@ -36,5 +35,7 @@ impl ObjectSubclass for SearchResultRow {
}
impl ObjectImpl for SearchResultRow {}
impl WidgetImpl for SearchResultRow {}
impl BoxImpl for SearchResultRow {}

View file

@ -1,13 +1,14 @@
use crate::icon_source;
use crate::BoxedSearchResult;
use gtk4 as gtk;
mod imp;
use crate::SearchResultObject;
use gtk::glib;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use crate::BoxedSearchResult;
use crate::icon_source;
use crate::SearchResultObject;
mod imp;
glib::wrapper! {
pub struct SearchResultRow(ObjectSubclass<imp::SearchResultRow>)
@extends gtk::Widget, gtk::Box;