Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
More places sidebar properties
- Loading branch information
Showing
3 changed files
with
148 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,74 @@ | ||
| use v6; | ||
|
|
||
| use NativeCall; | ||
| use GTK::Simple::Raw :places-sidebar; | ||
| use GTK::Simple::Raw :places-sidebar, :DEFAULT; | ||
| use GTK::Simple::Common; | ||
| use GTK::Simple::Widget; | ||
|
|
||
| unit class GTK::Simple::PlacesSidebar does GTK::Simple::Widget; | ||
|
|
||
| has $!open-location-supply; | ||
|
|
||
| submethod BUILD() { | ||
| $!gtk_widget = gtk_places_sidebar_new(); | ||
| } | ||
|
|
||
| method local-only() | ||
| returns Bool | ||
| is gtk-property(>k_places_sidebar_get_local_only, >k_places_sidebar_set_local_only) | ||
| { * } | ||
|
|
||
| method open-flags() | ||
| returns GtkPlacesOpenFlags | ||
| is gtk-property(>k_places_sidebar_get_open_flags, >k_places_sidebar_set_open_flags) | ||
| { * } | ||
|
|
||
| #TODO populate-all | ||
| #method populate-all() | ||
| # returns Bool | ||
| # is gtk-property(>k_places_sidebar_get_text, >k_places_sidebar_set_text) | ||
| # { * } | ||
|
|
||
| method show-connect-to-server() | ||
| returns Bool | ||
| is gtk-property(>k_places_sidebar_get_connect_to_server, >k_places_sidebar_set_connect_to_server) | ||
| { * } | ||
|
|
||
| method show-desktop() | ||
| returns Bool | ||
| is gtk-property(>k_places_sidebar_get_show_desktop, >k_places_sidebar_set_show_desktop) | ||
| { * } | ||
|
|
||
| #TODO show-enter-location | ||
| #method show-enter-location() | ||
| # returns GFile | ||
| # is gtk-property(>k_places_sidebar_get_enter_location, >k_places_sidebar_set_enter_location) | ||
| # { * } | ||
|
|
||
| method show-other-locations() | ||
| returns Bool | ||
| is gtk-property(>k_places_sidebar_get_other_locations, >k_places_sidebar_set_other_locations) | ||
| { * } | ||
|
|
||
| method show-recent() | ||
| returns Bool | ||
| is gtk-property(>k_places_sidebar_get_show_recent, >k_places_sidebar_set_show_recent) | ||
| { * } | ||
|
|
||
| method show-trash() | ||
| returns Bool | ||
| is gtk-property(>k_places_sidebar_get_show_trash, >k_places_sidebar_set_show_trash) | ||
| { * } | ||
|
|
||
| method open-location() { | ||
| $!open-location-supply //= do { | ||
| my $s = Supplier.new; | ||
| g_signal_connect_wd($!gtk_widget, "open-location", | ||
| -> $, $ { | ||
| $s.emit(self); | ||
| CATCH { default { note $_; } } | ||
| }, | ||
| OpaquePointer, 0); | ||
| $s.Supply; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters