-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathSelectPictureDialog.vala
More file actions
52 lines (43 loc) · 1.71 KB
/
SelectPictureDialog.vala
File metadata and controls
52 lines (43 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class SelectPictureDialog : Hdy.Window {
public SelectPictureDialog (Gtk.Label title_label) {
var dialog_handle = new Hdy.WindowHandle () ;
var pic_dialog_title = new Gtk.Label ("Where can I find the image ?") ;
var main_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 10) ;
var cancel_btn = new Gtk.Button.with_label ("Cancel") ;
var take_screenshot_btn = new Gtk.Button.with_label ("Take Screenshot") ;
var choose_file_btn = new Gtk.Button.with_label ("Choose File") ;
var from_clipb_btn = new Gtk.Button.with_label ("Get from Clipboard") ;
default_height = 200 ;
default_width = 200 ;
set_position (Gtk.WindowPosition.MOUSE) ;
main_box.get_style_context ().add_class ("select-pic-box") ;
pic_dialog_title.get_style_context ().add_class ("dialog-title") ;
choose_file_btn.clicked.connect (() => {
hide () ;
perform_signal ("file") ;
}) ;
take_screenshot_btn.clicked.connect (() => {
hide () ;
perform_signal ("shot") ;
}) ;
from_clipb_btn.clicked.connect (() => {
hide () ;
perform_signal ("clip") ;
}) ;
cancel_btn.clicked.connect (() => {
cancel_signal () ;
}) ;
main_box.add (pic_dialog_title) ;
main_box.add (take_screenshot_btn) ;
main_box.add (choose_file_btn) ;
main_box.add (from_clipb_btn) ;
main_box.add (cancel_btn) ;
dialog_handle.add (main_box) ;
add (dialog_handle) ;
}
construct {
Hdy.init () ;
}
public signal void cancel_signal () ;
public signal void perform_signal (string image_source) ;
}