projects
/
cinaest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3daf038
)
Source list view: update style, get color from parent window style
author
Philipp Zabel
<philipp.zabel@gmail.com>
Thu, 8 Jul 2010 19:39:15 +0000
(21:39 +0200)
committer
Philipp Zabel
<philipp.zabel@gmail.com>
Wed, 14 Jul 2010 21:34:08 +0000
(23:34 +0200)
src/plugins/catalog-plugin.vala
patch
|
blob
|
history
src/source-dialog.vala
patch
|
blob
|
history
src/source-list-view.vala
patch
|
blob
|
history
src/source-list-window.vala
patch
|
blob
|
history
diff --git
a/src/plugins/catalog-plugin.vala
b/src/plugins/catalog-plugin.vala
index
3616e34
..
831fb3e
100644
(file)
--- a/
src/plugins/catalog-plugin.vala
+++ b/
src/plugins/catalog-plugin.vala
@@
-90,7
+90,7
@@
class CatalogPlugin : Plugin {
}
}
}
}
- var source_list = new SourceListView (available_sources, true);
+ var source_list = new SourceListView (available_sources, true, window);
var content = (VBox) dialog.get_content_area ();
content.pack_start (source_list, true, true, 0);
var content = (VBox) dialog.get_content_area ();
content.pack_start (source_list, true, true, 0);
@@
-202,7
+202,7
@@
class CatalogPlugin : Plugin {
dialog.set_transient_for (window);
dialog.set_title (_("Select active movie lists"));
dialog.set_transient_for (window);
dialog.set_title (_("Select active movie lists"));
- var source_list = new SourceListView (sources, false);
+ var source_list = new SourceListView (sources, false, window);
source_list.set_hildon_ui_mode (UIMode.EDIT);
var selection = source_list.get_selection ();
source_list.set_hildon_ui_mode (UIMode.EDIT);
var selection = source_list.get_selection ();
diff --git
a/src/source-dialog.vala
b/src/source-dialog.vala
index
35876c7
..
4e4b012
100644
(file)
--- a/
src/source-dialog.vala
+++ b/
src/source-dialog.vala
@@
-36,7
+36,7
@@
class SourceDialog : Gtk.Dialog {
}
}
}
}
- var source_list = new SourceListView (sources, true);
+ var source_list = new SourceListView (sources, true, window);
content.pack_start (source_list, true, true, 0);
source_list.source_activated.connect (on_source_activated);
content.pack_start (source_list, true, true, 0);
source_list.source_activated.connect (on_source_activated);
diff --git
a/src/source-list-view.vala
b/src/source-list-view.vala
index
64188be
..
df492e4
100644
(file)
--- a/
src/source-list-view.vala
+++ b/
src/source-list-view.vala
@@
-27,7
+27,7
@@
public class SourceListView : PannableArea {
public signal void source_activated (MovieSource source);
public signal void source_activated (MovieSource source);
- public SourceListView (List<MovieSource> list, bool _filtered) {
+ public SourceListView (List<MovieSource> list, bool _filtered, Gtk.Window window) {
filtered = _filtered;
// Source list
filtered = _filtered;
// Source list
@@
-65,28
+65,27
@@
public class SourceListView : PannableArea {
var vbox_renderer = new CellRendererVBox ();
var renderer = new CellRendererText ();
var vbox_renderer = new CellRendererVBox ();
var renderer = new CellRendererText ();
+ renderer.yalign = 1.0f;
vbox_renderer.append (renderer, true);
vbox_renderer.set_data ("name", renderer);
// Add description
renderer = new CellRendererText ();
vbox_renderer.append (renderer, true);
vbox_renderer.set_data ("name", renderer);
// Add description
renderer = new CellRendererText ();
- renderer.set ("ellipsize", Pango.EllipsizeMode.END);
+ renderer.yalign = 0;
+ renderer.ellipsize = Pango.EllipsizeMode.END;
Pango.AttrList attr_list = new Pango.AttrList ();
Pango.AttrList attr_list = new Pango.AttrList ();
- var style = Gtk.rc_get_style_by_paths (this.get_settings (), "SmallSystemFont", null, typeof (void));
+ var style = Gtk.rc_get_style_by_paths (Gtk.Settings.get_default (), "SmallSystemFont", null, typeof (void));
if (style != null) {
var attr_font_desc = new Pango.AttrFontDesc (style.font_desc.copy ());
attr_list.insert ((owned) attr_font_desc);
if (style != null) {
var attr_font_desc = new Pango.AttrFontDesc (style.font_desc.copy ());
attr_list.insert ((owned) attr_font_desc);
- } else {
- Pango.Attribute attr_font_scale = Pango.attr_scale_new (Pango.Scale.SMALL);
- attr_list.insert ((owned) attr_font_scale);
}
Gdk.Color color;
}
Gdk.Color color;
- if (!style.lookup_color ("SecondaryTextColor", out color)) {
- Gdk.Color.parse ("grey", out color);
+ window.ensure_style ();
+ if (window.style.lookup_color ("SecondaryTextColor", out color)) {
+ Pango.Attribute attr_color = Pango.attr_foreground_new (color.red, color.green, color.blue);
+ attr_list.insert ((owned) attr_color);
}
}
- Pango.Attribute attr_color = Pango.attr_foreground_new (color.red, color.green, color.blue);
- attr_list.insert ((owned) attr_color);
renderer.attributes = attr_list;
vbox_renderer.append (renderer, true);
renderer.attributes = attr_list;
vbox_renderer.append (renderer, true);
diff --git
a/src/source-list-window.vala
b/src/source-list-window.vala
index
98f3df3
..
708ad16
100644
(file)
--- a/
src/source-list-window.vala
+++ b/
src/source-list-window.vala
@@
-35,7
+35,7
@@
public class SourceListWindow : StackableWindow {
set_main_menu (menu);
var sources = new List<MovieSource> ();
set_main_menu (menu);
var sources = new List<MovieSource> ();
- source_list = new SourceListView (sources, true);
+ source_list = new SourceListView (sources, true, this);
alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
alignment.top_padding = MARGIN_HALF;
alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
alignment.top_padding = MARGIN_HALF;