[latexila] Utils.add_scrollbar(): returns ScrolledWindow type
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Utils.add_scrollbar(): returns ScrolledWindow type
- Date: Thu, 9 Aug 2012 23:11:24 +0000 (UTC)
commit de812aac78d5bf7fd485cc0a5e88dc38223da022
Author: SÃbastien Wilmet <swilmet gnome org>
Date: Thu Aug 9 22:06:22 2012 +0200
Utils.add_scrollbar(): returns ScrolledWindow type
src/bottom_panel.vala | 3 +--
src/build_tool_dialog.vala | 3 +--
src/build_tools_preferences.vala | 2 +-
src/clean_build_files.vala | 2 +-
src/dialogs.vala | 2 +-
src/file_browser.vala | 2 +-
src/structure.vala | 4 ++--
src/symbols_view.vala | 2 +-
src/templates_dialogs.vala | 9 ++++-----
src/utils.vala | 8 ++++----
10 files changed, 17 insertions(+), 20 deletions(-)
---
diff --git a/src/bottom_panel.vala b/src/bottom_panel.vala
index f1ee38c..13a5d27 100644
--- a/src/bottom_panel.vala
+++ b/src/bottom_panel.vala
@@ -27,8 +27,7 @@ public class BottomPanel : Grid
{
set_orientation (Orientation.HORIZONTAL);
- ScrolledWindow scrolled_window =
- Utils.add_scrollbar (build_view) as ScrolledWindow;
+ ScrolledWindow scrolled_window = Utils.add_scrollbar (build_view);
scrolled_window.expand = true;
scrolled_window.show_all ();
diff --git a/src/build_tool_dialog.vala b/src/build_tool_dialog.vala
index b24631e..98ebedc 100644
--- a/src/build_tool_dialog.vala
+++ b/src/build_tool_dialog.vala
@@ -626,8 +626,7 @@ public class BuildToolDialog : GLib.Object
_jobs_view.expand = true;
- ScrolledWindow scrolled_window =
- Utils.add_scrollbar (_jobs_view) as ScrolledWindow;
+ ScrolledWindow scrolled_window = Utils.add_scrollbar (_jobs_view);
scrolled_window.set_size_request (600, 80);
scrolled_window.set_shadow_type (ShadowType.IN);
diff --git a/src/build_tools_preferences.vala b/src/build_tools_preferences.vala
index cf343f2..499e1ec 100644
--- a/src/build_tools_preferences.vala
+++ b/src/build_tools_preferences.vala
@@ -132,7 +132,7 @@ public class BuildToolsPreferences : GLib.Object
private Grid join_view_and_toolbar (TreeView view, Toolbar toolbar)
{
view.expand = true;
- ScrolledWindow scrolled_window = Utils.add_scrollbar (view) as ScrolledWindow;
+ ScrolledWindow scrolled_window = Utils.add_scrollbar (view);
scrolled_window.set_shadow_type (ShadowType.IN);
scrolled_window.set_size_request (350, 200);
diff --git a/src/clean_build_files.vala b/src/clean_build_files.vala
index d9239ba..6e42fca 100644
--- a/src/clean_build_files.vala
+++ b/src/clean_build_files.vala
@@ -268,7 +268,7 @@ public class CleanBuildFiles : GLib.Object
grid.attach (select_label, 1, 1, 1, 1);
/* list of files with a scrollbar */
- ScrolledWindow sw = Utils.add_scrollbar (list_files) as ScrolledWindow;
+ ScrolledWindow sw = Utils.add_scrollbar (list_files);
sw.set_shadow_type (ShadowType.IN);
sw.expand = true;
grid.attach (sw, 1, 2, 1, 1);
diff --git a/src/dialogs.vala b/src/dialogs.vala
index 39f6cc0..11330ba 100644
--- a/src/dialogs.vala
+++ b/src/dialogs.vala
@@ -119,7 +119,7 @@ namespace Dialogs
treeview.append_column (column);
// with a scrollbar
- ScrolledWindow sw = (ScrolledWindow) Utils.add_scrollbar (treeview);
+ ScrolledWindow sw = Utils.add_scrollbar (treeview);
sw.set_shadow_type (ShadowType.IN);
sw.expand = true;
grid.attach (sw, 1, 2, 1, 1);
diff --git a/src/file_browser.vala b/src/file_browser.vala
index e5812fc..a8f5820 100644
--- a/src/file_browser.vala
+++ b/src/file_browser.vala
@@ -318,7 +318,7 @@ public class FileBrowser : Grid
context.set_junction_sides (JunctionSides.BOTTOM);
list.expand = true;
- ScrolledWindow scrolled_window = Utils.add_scrollbar (list) as ScrolledWindow;
+ ScrolledWindow scrolled_window = Utils.add_scrollbar (list);
scrolled_window.set_shadow_type (ShadowType.IN);
context = scrolled_window.get_style_context ();
diff --git a/src/structure.vala b/src/structure.vala
index 52fe413..9722bce 100644
--- a/src/structure.vala
+++ b/src/structure.vala
@@ -312,7 +312,7 @@ public class Structure : Grid
_list_view.row_activated.connect ((path) => select_list_row (path));
// with a scrollbar
- _list_view_sw = Utils.add_scrollbar (_list_view) as ScrolledWindow;
+ _list_view_sw = Utils.add_scrollbar (_list_view);
_list_view_sw.set_shadow_type (ShadowType.IN);
_vpaned.add1 (_list_view_sw);
@@ -360,7 +360,7 @@ public class Structure : Grid
});
// with a scrollbar
- ScrolledWindow sw = Utils.add_scrollbar (_tree_view) as ScrolledWindow;
+ ScrolledWindow sw = Utils.add_scrollbar (_tree_view);
sw.set_shadow_type (ShadowType.IN);
_vpaned.add2 (sw);
diff --git a/src/symbols_view.vala b/src/symbols_view.vala
index 6b8405f..10d941c 100644
--- a/src/symbols_view.vala
+++ b/src/symbols_view.vala
@@ -45,7 +45,7 @@ public class SymbolsView : Grid
add (_combo_box);
- ScrolledWindow sw = Utils.add_scrollbar (_symbol_view) as ScrolledWindow;
+ ScrolledWindow sw = Utils.add_scrollbar (_symbol_view);
sw.set_shadow_type (ShadowType.IN);
add (sw);
diff --git a/src/templates_dialogs.vala b/src/templates_dialogs.vala
index 58d09c9..c15712e 100644
--- a/src/templates_dialogs.vala
+++ b/src/templates_dialogs.vala
@@ -49,8 +49,7 @@ public class OpenTemplateDialog
// List of default templates.
_default_templates = templates.get_default_templates_list ();
- ScrolledWindow scrollbar =
- Utils.add_scrollbar (_default_templates) as ScrolledWindow;
+ ScrolledWindow scrollbar = Utils.add_scrollbar (_default_templates);
scrollbar.set_shadow_type (ShadowType.IN);
scrollbar.set_size_request (250, 200);
Widget component = Utils.get_dialog_component (_("Default templates"), scrollbar);
@@ -59,7 +58,7 @@ public class OpenTemplateDialog
// List of personal templates.
_personal_templates = templates.get_personal_templates_list ();
- scrollbar = Utils.add_scrollbar (_personal_templates) as ScrolledWindow;
+ scrollbar = Utils.add_scrollbar (_personal_templates);
scrollbar.set_shadow_type (ShadowType.IN);
scrollbar.set_size_request (250, 200);
component = Utils.get_dialog_component (_("Your personal templates"), scrollbar);
@@ -193,7 +192,7 @@ public class CreateTemplateDialog : Dialog
// Take the default store because it contains all the icons.
TreeView templates_list = templates.get_default_templates_list ();
- ScrolledWindow scrollbar = Utils.add_scrollbar (templates_list) as ScrolledWindow;
+ ScrolledWindow scrollbar = Utils.add_scrollbar (templates_list);
scrollbar.set_shadow_type (ShadowType.IN);
scrollbar.set_size_request (250, 200);
component = Utils.get_dialog_component (_("Choose an icon"), scrollbar);
@@ -254,7 +253,7 @@ public class DeleteTemplateDialog : Dialog
TreeSelection select = templates_list.get_selection ();
select.set_mode (SelectionMode.MULTIPLE);
- ScrolledWindow scrollbar = Utils.add_scrollbar (templates_list) as ScrolledWindow;
+ ScrolledWindow scrollbar = Utils.add_scrollbar (templates_list);
scrollbar.set_shadow_type (ShadowType.IN);
scrollbar.set_size_request (250, 150);
Widget component = Utils.get_dialog_component (_("Personal templates"),
diff --git a/src/utils.vala b/src/utils.vala
index 90263ff..db8922b 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -289,11 +289,11 @@ namespace Utils
/*************************************************************************/
// UI stuff
- public Widget add_scrollbar (Widget child)
+ public ScrolledWindow add_scrollbar (Widget child)
{
- ScrolledWindow scrollbar = new ScrolledWindow (null, null);
- scrollbar.add (child);
- return scrollbar;
+ ScrolledWindow sw = new ScrolledWindow (null, null);
+ sw.add (child);
+ return sw;
}
public bool tree_model_iter_prev (TreeModel model, ref TreeIter iter)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]