[gnome-boxes] Allow clicking on thumbnail in properties view
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Allow clicking on thumbnail in properties view
- Date: Fri, 2 Nov 2012 13:11:57 +0000 (UTC)
commit bb5ee045eb9e603834bdf9139551c041eedfdc49
Author: Alexander Larsson <alexl redhat com>
Date: Wed Oct 31 13:42:29 2012 +0100
Allow clicking on thumbnail in properties view
This connects to the vm.
https://bugzilla.gnome.org/show_bug.cgi?id=677714
src/machine.vala | 11 +++++++++--
src/topbar.vala | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/machine.vala b/src/machine.vala
index 8583bf0..c52ba45 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -601,6 +601,7 @@ private class Boxes.MachineActor: Boxes.UI {
thumbnail = new GtkClutter.Actor.with_contents (display_widget);
} else {
thumbnail_screenshot = new GtkClutter.Texture ();
+ thumbnail_screenshot.set_reactive (true);
try {
thumbnail_screenshot.set_from_pixbuf (machine.pixbuf);
} catch (GLib.Error err) {
@@ -613,14 +614,20 @@ private class Boxes.MachineActor: Boxes.UI {
thumbnail.y_align = Clutter.ActorAlign.FILL;
App.app.overlay_bin_actor.add_child (thumbnail);
+ var click = new Clutter.ClickAction ();
+ thumbnail.add_action (click);
+
if (display_widget != null) {
- var click = new Clutter.ClickAction ();
- thumbnail.add_action (click);
click.clicked.connect (() => {
App.app.ui_state = Boxes.UIState.DISPLAY;
});
machine.display.set_enable_inputs (display_widget, false);
+ } else {
+ click.clicked.connect (() => {
+ App.app.connect_to (machine, thumbnail.allocation.x1, thumbnail.allocation.y1);
+ update_thumbnail (null, false);
+ });
}
Boxes.ActorFunc update_screenshot_alloc = (thumbnail) => {
diff --git a/src/topbar.vala b/src/topbar.vala
index 0531026..a7ef926 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -155,6 +155,7 @@ private class Boxes.Topbar: Boxes.UI {
break;
case UIState.CREDS:
+ notebook.page = TopbarPage.COLLECTION;
new_btn.hide ();
back_btn.show ();
spinner.show ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]