Browse Source

add pango dep to align text (not working though?)

master
Paul Lesur 2 years ago
parent
commit
00f5e0cf0c
3 changed files with 5 additions and 0 deletions
  1. 1
    0
      Cargo.lock
  2. 1
    0
      Cargo.toml
  3. 3
    0
      src/main_window.rs

+ 1
- 0
Cargo.lock View File

@@ -320,6 +320,7 @@ dependencies = [
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"relm 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",

+ 1
- 0
Cargo.toml View File

@@ -12,6 +12,7 @@ gtk = "^0.7.0"
relm = "^0.17.0"
relm-derive = "^0.17.0"
gdk = "0.11.0"
pango = "0.7.0"
# qol
num-traits = "0.2"
num-derive = "0.2.5"

+ 3
- 0
src/main_window.rs View File

@@ -15,6 +15,7 @@ use gdk;
use gtk::Orientation::{Horizontal, Vertical};
use gtk::*;
use log::debug;
use pango;
use relm::{connect, connect_stream, Widget};
use relm_derive::widget;

@@ -173,6 +174,7 @@ impl Widget for MainWindow {
col.set_title(&self.model.translation_provider.spending_amount_header());
let cell = gtk::CellRendererText::new();
cell.set_property_editable(true);
cell.set_property_alignment(pango::Alignment::Right);
col.pack_start(&cell, true);
col.add_attribute(&cell, "text", Amount.into());
col.add_attribute(&cell, "background", AmountBackgroundColor.into());
@@ -193,6 +195,7 @@ impl Widget for MainWindow {
cell.set_property_editable(true);
cell.set_property_has_entry(false);
cell.set_property_text_column(0);
cell.set_property_alignment(pango::Alignment::Right);
col.pack_start(&cell, true);
col.add_attribute(&cell, "text", Day.into());
col.add_attribute(&cell, "background", DayBackgroundColor.into());

Loading…
Cancel
Save