[cheese/three-point-oh] Setting Image properties (contrast, hue, brightness and saturation) on preferences window works
- From: Yuvaraj Pandian <yuvipanda src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/three-point-oh] Setting Image properties (contrast, hue, brightness and saturation) on preferences window works
- Date: Tue, 13 Jul 2010 18:23:22 +0000 (UTC)
commit d6acfeea2cc73b37322891f4ff19a082f912e504
Author: Yuvaraj Pandian T <yuvipanda gmail com>
Date: Tue Jul 13 23:52:35 2010 +0530
Setting Image properties (contrast, hue, brightness and saturation) on preferences window works
Need to sync with gconf
data/cheese-prefs.ui | 46 +++++++++++++++++++++++-------------------
src/cheese-preferences.vala | 24 ++++++++++++++++++++++
src/cheese-window.vala | 2 +-
3 files changed, 50 insertions(+), 22 deletions(-)
---
diff --git a/data/cheese-prefs.ui b/data/cheese-prefs.ui
index 2d5e7a0..e8902ae 100644
--- a/data/cheese-prefs.ui
+++ b/data/cheese-prefs.ui
@@ -3,39 +3,43 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="brightness_adjustment">
- <property name="value">2</property>
- <property name="lower">3</property>
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="value">0</property>
+ <property name="lower">-1</property>
+ <property name="upper">1</property>
+ <property name="step_increment">0.01</property>
+ <property name="page_increment">0.1</property>
+ <signal name="value-changed" handler="cheese_preferences_dialog_on_brightness_change" />
</object>
<object class="GtkAdjustment" id="contrast_adjustment">
- <property name="value">2</property>
- <property name="lower">3</property>
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="value">1</property>
+ <property name="lower">0</property>
+ <property name="upper">2</property>
+ <property name="step_increment">0.01</property>
+ <property name="page_increment">0.1</property>
+ <signal name="value-changed" handler="cheese_preferences_dialog_on_contrast_change" />
</object>
<object class="GtkAdjustment" id="hue_adjustment">
- <property name="value">2</property>
- <property name="lower">3</property>
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="value">0</property>
+ <property name="lower">-1</property>
+ <property name="upper">1</property>
+ <property name="step_increment">0.01</property>
+ <property name="page_increment">0.1</property>
+ <signal name="value-changed" handler="cheese_preferences_dialog_on_hue_change" />
</object>
<object class="GtkAdjustment" id="saturation_adjustment">
- <property name="value">2</property>
- <property name="lower">3</property>
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="value">1</property>
+ <property name="lower">0</property>
+ <property name="upper">2</property>
+ <property name="step_increment">0.01</property>
+ <property name="page_increment">0.1</property>
+ <signal name="value-changed" handler="cheese_preferences_dialog_on_saturation_change" />
</object>
<object class="GtkAdjustment" id="burst_count_adjustment">
<property name="value">2</property>
<property name="lower">3</property>
<property name="upper">100</property>
<property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="burst_delay_adjustment">
<property name="lower">1</property>
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index 63e79f5..f4e5297 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -51,6 +51,30 @@ internal class Cheese.PreferencesDialog : GLib.Object
this.dialog.hide_all ();
}
+ [CCode (instance_pos = -1)]
+ internal void on_brightness_change (Gtk.Adjustment adjustment)
+ {
+ this.camera.set_balance_property ("brightness", adjustment.value);
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_contrast_change (Gtk.Adjustment adjustment)
+ {
+ this.camera.set_balance_property ("contrast", adjustment.value);
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_hue_change (Gtk.Adjustment adjustment)
+ {
+ this.camera.set_balance_property ("hue", adjustment.value);
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_saturation_change (Gtk.Adjustment adjustment)
+ {
+ this.camera.set_balance_property ("saturation", adjustment.value);
+ }
+
public void show ()
{
this.dialog.show_all ();
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 7fa23d3..e3d94e2 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -114,7 +114,7 @@ public class Cheese.MainWindow : Gtk.Window
}
}
else
- if (event.type == Gdk.EventType .2BUTTON _PRESS)
+ if (event.type == Gdk.EventType.2BUTTON_PRESS)
{
on_file_open (null);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]