removes initial pawns, adds utf-8 support
This commit is contained in:
10
src/grid.rs
10
src/grid.rs
@@ -74,7 +74,7 @@ impl CellWidget {
|
|||||||
name: builder.get_object("name").unwrap(),
|
name: builder.get_object("name").unwrap(),
|
||||||
desc_btn: builder.get_object("desc_btn").unwrap(),
|
desc_btn: builder.get_object("desc_btn").unwrap(),
|
||||||
targets: vec![
|
targets: vec![
|
||||||
gtk::TargetEntry::new("text/plain", gtk::TargetFlags::SAME_APP, 0),
|
gtk::TargetEntry::new("text/plain;charset=utf-8", gtk::TargetFlags::SAME_APP, 0),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
cell.desc_btn.set_visible(false);
|
cell.desc_btn.set_visible(false);
|
||||||
@@ -102,9 +102,13 @@ impl CellWidget {
|
|||||||
println!("Send...");
|
println!("Send...");
|
||||||
// TODO: Refactoring, this is the inverse of 'placing',
|
// TODO: Refactoring, this is the inverse of 'placing',
|
||||||
// building a PawnData instead of destructuring it.
|
// building a PawnData instead of destructuring it.
|
||||||
if let Some(to_send) = c.name.get_text() {
|
if let Some(to_send) = c.name
|
||||||
|
.get_text()
|
||||||
|
{
|
||||||
|
dbg!(&to_send);
|
||||||
data.set_text(&to_send);
|
data.set_text(&to_send);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
dbg!("Should not happen !!");
|
dbg!("Should not happen !!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -157,9 +157,6 @@ impl App {
|
|||||||
let pawn_list = pawn::PawnList::init(pawn_list);
|
let pawn_list = pawn::PawnList::init(pawn_list);
|
||||||
app_state.borrow_mut().pawns.replace(pawn_list);
|
app_state.borrow_mut().pawns.replace(pawn_list);
|
||||||
|
|
||||||
for pawn in pawn::pawn_factory() {
|
|
||||||
app_state.add_pawn(&pawn);
|
|
||||||
}
|
|
||||||
win.show_all(); // Before grid because we want to hide some widgets there
|
win.show_all(); // Before grid because we want to hide some widgets there
|
||||||
// Initialize grid
|
// Initialize grid
|
||||||
let grid: gtk::Grid = builder.get_object("map").unwrap();
|
let grid: gtk::Grid = builder.get_object("map").unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user