f-spot r4387 - in trunk: . src src/Widgets
- From: lmilesi svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4387 - in trunk: . src src/Widgets
- Date: Tue, 16 Sep 2008 20:02:14 +0000 (UTC)
Author: lmilesi
Date: Tue Sep 16 20:02:13 2008
New Revision: 4387
URL: http://svn.gnome.org/viewvc/f-spot?rev=4387&view=rev
Log:
2008-09-16 Lorenzo Milesi <maxxer yetopen it>
* src/InfoOverlay.cs: set fixed width to 250. default width was
ellipsizing too many strings.
* src/Widgets/InfoBox.cs: display rating widget in fullscreen infobox.
Modified:
trunk/ChangeLog
trunk/src/InfoOverlay.cs
trunk/src/Widgets/InfoBox.cs
Modified: trunk/src/InfoOverlay.cs
==============================================================================
--- trunk/src/InfoOverlay.cs (original)
+++ trunk/src/InfoOverlay.cs Tue Sep 16 20:02:13 2008
@@ -21,6 +21,7 @@
HandleItemChanged (item, null);
VersionIdChanged += HandleVersionIdChanged;
ShowTags = true;
+ ShowRating = true;
Context = ViewContext.FullScreen;
}
@@ -48,6 +49,7 @@
{
XAlign = 1.0;
YAlign = 0.1;
+ DefaultWidth = 250;
box = new InfoItem (item);
box.BorderWidth = 15;
Add (box);
Modified: trunk/src/Widgets/InfoBox.cs
==============================================================================
--- trunk/src/Widgets/InfoBox.cs (original)
+++ trunk/src/Widgets/InfoBox.cs Tue Sep 16 20:02:13 2008
@@ -58,6 +58,19 @@
tag_view.Visible = show_tags;
}
}
+
+ private bool show_rating = false;
+ public bool ShowRating {
+ get { return show_rating; }
+ set {
+ if (show_rating == value)
+ return;
+
+ show_rating = value;
+ rating_label.Visible = show_rating;
+ rating_view.Visible = show_rating;
+ }
+ }
public delegate void VersionIdChangedHandler (InfoBox info_box, uint version_id);
public event VersionIdChangedHandler VersionIdChanged;
@@ -101,6 +114,9 @@
private Label exposure_label;
private Label exposure_value_label;
+ private Label rating_label;
+ private RatingSmall rating_view;
+
private TagView tag_view;
private string default_exposure_string;
@@ -110,6 +126,11 @@
VersionIdChanged (this, menu.VersionId);
}
+ private void HandleRatingChanged (object o, EventArgs e)
+ {
+ MainWindow.Toplevel.HandleRatingMenuSelected ((o as Widgets.Rating).Value);
+ }
+
private Label CreateRightAlignedLabel (string text)
{
Label label = new Label ();
@@ -163,7 +184,7 @@
ContextSwitchStrategy.SetInfoBoxVisible (Context, info_expander.Expanded);
};
- Table info_table = new Table (6, 2, false);
+ Table info_table = new Table (7, 2, false);
info_table.BorderWidth = 0;
string name_pre = "<b>";
@@ -184,7 +205,11 @@
default_exposure_string = name_pre + Catalog.GetString ("Exposure") + name_post;
exposure_label = CreateRightAlignedLabel (default_exposure_string);
info_table.Attach (exposure_label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
-
+
+ rating_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Rating") + name_post);
+ info_table.Attach (rating_label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
+ rating_label.Visible = false;
+
name_value_label = new Label ();
name_value_label.Ellipsize = Pango.EllipsizeMode.Middle;
name_value_label.Justify = Gtk.Justification.Left;
@@ -201,14 +226,25 @@
date_value_label.Text = Environment.NewLine;
exposure_value_label.Text = Environment.NewLine;
-
+
+ Gtk.Alignment rating_align = new Gtk.Alignment( 0, 0, 0, 0);
+ info_table.Attach (rating_align, 1, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
+
+ rating_view = new RatingSmall ();
+ rating_view.Visible = false;
+ rating_view.Changed += HandleRatingChanged;
+ rating_align.Add (rating_view);
+
tag_view = new TagView (MainWindow.ToolTips);
- info_table.Attach (tag_view, 0, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
+ info_table.Attach (tag_view, 0, 2, 6, 7, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
tag_view.Show ();
+
info_table.ShowAll ();
info_expander.Add (info_table);
Add (info_expander);
+ rating_label.Visible = show_rating;
+ rating_view.Visible = show_rating;
}
private class ImageInfo : StatementSink {
@@ -416,8 +452,13 @@
}
if (show_tags)
tag_view.Current = photo;
+ rating_label.Visible = show_rating;
+ rating_view.Visible = show_rating;
+ if (show_rating) {
+ rating_view.Value = (int) photo.Rating;
+ }
- Show ();
+ Show ();
}
private void UpdateMultiple ()
@@ -449,6 +490,9 @@
size_label.Visible = false;
size_value_label.Visible = false;
+
+ rating_label.Visible = false;
+ rating_view.Visible = false;
}
private Gdk.Pixbuf histogram_hint;
@@ -526,7 +570,7 @@
histogram_delay = new Delay (DelayedUpdateHistogram);
BorderWidth = 2;
- Hide ();
+ Hide ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]