mirror of
https://github.com/13hannes11/focus_annotator.git
synced 2024-09-03 23:21:01 +02:00
add file chooser button
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -4,7 +4,7 @@ use std::sync::Arc;
|
||||
use adw::{prelude::*, ApplicationWindow, HeaderBar, SplitButton};
|
||||
use gio::SimpleAction;
|
||||
use glib::clone;
|
||||
use gtk::{gio, glib};
|
||||
use gtk::{gio, glib, FileChooserAction, FileChooserDialog, ResponseType};
|
||||
use gtk::{
|
||||
ActionBar, Application, AspectFrame, Box, Button, Grid, Image, Orientation, PositionType,
|
||||
Scale, Separator, ToggleButton,
|
||||
@@ -374,6 +374,17 @@ fn main() {
|
||||
.content(&application_vertical_widget)
|
||||
.build();
|
||||
|
||||
|
||||
open_button.connect_clicked(clone!(@weak window => move |_| {
|
||||
let file_chooser_action = FileChooserAction::Open;
|
||||
|
||||
// TODO: actually open and load data
|
||||
|
||||
let buttons = [("Open", ResponseType::Accept)];
|
||||
let file_chooser = FileChooserDialog::new(Some("Chose a data file!"), Some(&window), file_chooser_action, &buttons);
|
||||
file_chooser.show();
|
||||
}));
|
||||
|
||||
////////////////////////
|
||||
// Keyboard Shortcuts //
|
||||
////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user