[chronojump] Minor fix
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Minor fix
- Date: Thu, 18 Jun 2015 21:34:20 +0000 (UTC)
commit 5365bf2c26accffe4a1a0e6010e2f404307faca7
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Jun 18 23:13:14 2015 +0200
Minor fix
src/gui/encoderConfiguration.cs | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/src/gui/encoderConfiguration.cs b/src/gui/encoderConfiguration.cs
index 9c128a8..67461d9 100644
--- a/src/gui/encoderConfiguration.cs
+++ b/src/gui/encoderConfiguration.cs
@@ -175,30 +175,35 @@ public class EncoderConfigurationWindow
private void initializeList(Constants.EncoderType type, bool inertial, int position) {
list = UtilEncoder.EncoderConfigurationList(type, inertial);
- button_previous.Sensitive = (list.Count > 1);
- button_next.Sensitive = (list.Count > 1);
-
listCurrent = position; //current item on list
+ buttons_previous_next_sensitive();
selectedModeChanged();
}
private void on_button_previous_clicked (object o, EventArgs args) {
listCurrent --;
if(listCurrent < 0)
- listCurrent = list.Count -1;
+ listCurrent = 0;
+ buttons_previous_next_sensitive();
selectedModeChanged();
}
private void on_button_next_clicked (object o, EventArgs args) {
listCurrent ++;
if(listCurrent > list.Count -1)
- listCurrent = 0;
-
+ listCurrent = list.Count -1;
+
+ buttons_previous_next_sensitive();
selectedModeChanged();
}
+ private void buttons_previous_next_sensitive() {
+ button_previous.Sensitive = (listCurrent > 0);
+ button_next.Sensitive = (listCurrent < list.Count -1);
+ }
+
private void selectedModeChanged() {
EncoderConfiguration ec = (EncoderConfiguration) list[listCurrent];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]