ui changes
This commit is contained in:
parent
1be42eb584
commit
eb26ca7418
|
@ -3,7 +3,7 @@
|
||||||
<template class="MemoryCardsEditScene" parent="GtkApplicationWindow">
|
<template class="MemoryCardsEditScene" parent="GtkApplicationWindow">
|
||||||
<property name="title">Memory cards edit</property>
|
<property name="title">Memory cards edit</property>
|
||||||
<property name="height-request">1000</property>
|
<property name="height-request">1000</property>
|
||||||
<property name="width-request">1000</property>
|
<property name="width-request">200</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="content">
|
<object class="GtkBox" id="content">
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
|
@ -43,9 +43,7 @@
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="hexpand">true</property>
|
<property name="hexpand">true</property>
|
||||||
<property name="hexpand-set">true</property>
|
<property name="hexpand-set">true</property>
|
||||||
<property name="vexpand">true</property>
|
<!-- <property name="homogeneous">true</property> -->
|
||||||
<property name="vexpand-set">true</property>
|
|
||||||
<property name="homogeneous">true</property>
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="halign">GTK_ALIGN_FILL</property>
|
<property name="halign">GTK_ALIGN_FILL</property>
|
||||||
<property name="valign">GTK_ALIGN_FILL</property>
|
<property name="valign">GTK_ALIGN_FILL</property>
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
<property name="width-request">512</property>
|
<property name="width-request">512</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="content">
|
<object class="GtkBox" id="content">
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="halign">GTK_ALIGN_CENTER</property>
|
||||||
|
<property name="valign">GTK_ALIGN_CENTER</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkPicture" id="picture">
|
<object class="GtkPicture" id="picture">
|
||||||
<property name="halign">GTK_ALIGN_CENTER</property>
|
<property name="halign">GTK_ALIGN_CENTER</property>
|
||||||
|
|
|
@ -2,28 +2,46 @@
|
||||||
<interface>
|
<interface>
|
||||||
<template class="CardEntry" parent="GtkWidget">
|
<template class="CardEntry" parent="GtkWidget">
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkPicture" id="picture">
|
<object class="GtkGrid">
|
||||||
<property name="halign">GTK_ALIGN_START</property>
|
<child>
|
||||||
<property name="valign">GTK_ALIGN_CENTER</property>
|
<object class="GtkPicture" id="picture">
|
||||||
</object>
|
<property name="halign">GTK_ALIGN_START</property>
|
||||||
</child>
|
<property name="valign">GTK_ALIGN_CENTER</property>
|
||||||
<child>
|
<layout>
|
||||||
<object class="GtkLabel" id="hieroglyph_label">
|
<property name="column">0</property>
|
||||||
<property name="halign">GTK_ALIGN_START</property>
|
</layout>
|
||||||
<property name="valign">GTK_ALIGN_CENTER</property>
|
</object>
|
||||||
</object>
|
</child>
|
||||||
</child>
|
<child>
|
||||||
<child>
|
<object class="GtkLabel" id="hieroglyph_label">
|
||||||
<object class="GtkLabel" id="reading_label">
|
<property name="halign">GTK_ALIGN_START</property>
|
||||||
<property name="halign">GTK_ALIGN_START</property>
|
<property name="valign">GTK_ALIGN_CENTER</property>
|
||||||
<property name="valign">GTK_ALIGN_CENTER</property>
|
<layout>
|
||||||
</object>
|
<property name="column">1</property>
|
||||||
</child>
|
</layout>
|
||||||
<child>
|
</object>
|
||||||
<object class="GtkButton" id="delete_button">
|
</child>
|
||||||
<property name="halign">GTK_ALIGN_END</property>
|
<child>
|
||||||
<property name="valign">GTK_ALIGN_CENTER</property>
|
<object class="GtkLabel" id="reading_label">
|
||||||
<property name="label">delete</property>
|
<property name="halign">GTK_ALIGN_START</property>
|
||||||
|
<property name="valign">GTK_ALIGN_CENTER</property>
|
||||||
|
<layout>
|
||||||
|
<property name="column">2</property>
|
||||||
|
</layout>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="delete_button">
|
||||||
|
<property name="halign">GTK_ALIGN_END</property>
|
||||||
|
<property name="valign">GTK_ALIGN_CENTER</property>
|
||||||
|
<property name="label">delete</property>
|
||||||
|
<property name="hexpand">true</property>
|
||||||
|
<property name="hexpand-set">true</property>
|
||||||
|
<layout>
|
||||||
|
<property name="column">3</property>
|
||||||
|
</layout>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -139,7 +139,6 @@ impl MemoryCardsEditScene {
|
||||||
let connection = Connection::open(get_db_path()).unwrap();
|
let connection = Connection::open(get_db_path()).unwrap();
|
||||||
let imagepath = card.imagepath();
|
let imagepath = card.imagepath();
|
||||||
let imagename = &Path::new(&imagepath).file_name().unwrap().to_str().unwrap();
|
let imagename = &Path::new(&imagepath).file_name().unwrap().to_str().unwrap();
|
||||||
dbg!("removing {}", imagename);
|
|
||||||
fs::remove_file(get_images_store_path() + "/" + &imagename).expect("Could not remove file!");
|
fs::remove_file(get_images_store_path() + "/" + &imagename).expect("Could not remove file!");
|
||||||
connection.execute("DELETE FROM cards WHERE imagename = ?1", [&imagename]).unwrap();
|
connection.execute("DELETE FROM cards WHERE imagename = ?1", [&imagename]).unwrap();
|
||||||
self_binding.imp().query_cards(None);
|
self_binding.imp().query_cards(None);
|
||||||
|
|
Loading…
Reference in New Issue