[fractal] Ctrl+PgDn should switch to the first room if none is selected
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] Ctrl+PgDn should switch to the first room if none is selected
- Date: Wed, 16 Sep 2020 14:00:15 +0000 (UTC)
commit 1971aa247f160caf29088b6d381a1caeb1a07f9a
Author: Vancha March <vancha@192.168.2.5>
Date: Mon Sep 7 15:09:34 2020 +0200
Ctrl+PgDn should switch to the first room if none is selected
fractal-gtk/src/actions/global.rs | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/fractal-gtk/src/actions/global.rs b/fractal-gtk/src/actions/global.rs
index 9a079cb9..936e55cf 100644
--- a/fractal-gtk/src/actions/global.rs
+++ b/fractal-gtk/src/actions/global.rs
@@ -166,12 +166,20 @@ pub fn new(app: >k::Application, op: &Arc<Mutex<AppOp>>) {
let mut op = op.lock().unwrap();
if let Some(id) = op.roomlist.prev_id() {
op.set_active_room_by_id(id);
+ } else {
+ if let Some(last_room) = op.roomlist.last_id() {
+ op.set_active_room_by_id(last_room);
+ }
}
}));
next_room.connect_activate(clone!(@strong op => move |_, _| {
let mut op = op.lock().unwrap();
if let Some(id) = op.roomlist.next_id() {
op.set_active_room_by_id(id);
+ } else {
+ if let Some(first_room) = op.roomlist.first_id() {
+ op.set_active_room_by_id(first_room);
+ }
}
}));
prev_unread_room.connect_activate(clone!(@strong op => move |_, _| {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]