aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authortoshi <toshi@03aab468-d3d2-4883-8b12-f661bbf03fa8>2012-09-20 04:19:45 +0000
committertoshi <toshi@03aab468-d3d2-4883-8b12-f661bbf03fa8>2012-09-20 04:19:45 +0000
commit36fd59a8330ce3cab767d6610dd2968d1cff49a9 (patch)
tree1e58ad90d95779c91982233ce257974e9de1818f /core
parent8d5b3816dc4fb041ae35e56e123f59de142a1109 (diff)
downloadmikutter-36fd59a8330ce3cab767d6610dd2968d1cff49a9.tar.gz
コンソールの中のウィジェットを変更。ハンドルで大きさ変わるのと、フォーカスインしたときに常に入力ウィジェットにフォーカスが移る closes #500
git-svn-id: svn://toshia.dip.jp/mikutter/trunk@1023 03aab468-d3d2-4883-8b12-f661bbf03fa8
Diffstat (limited to 'core')
-rw-r--r--core/plugin/console/console.rb25
-rw-r--r--core/plugin/console/console_control.rb13
2 files changed, 28 insertions, 10 deletions
diff --git a/core/plugin/console/console.rb b/core/plugin/console/console.rb
index da07bc52..f4a3d9af 100644
--- a/core/plugin/console/console.rb
+++ b/core/plugin/console/console.rb
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+require File.expand_path File.join(File.dirname(__FILE__), 'console_control')
+
Plugin.create :console do
command(:console_open,
name: 'コンソールを開く',
@@ -16,7 +18,8 @@ Plugin.create :console do
widget_result.set_editable(false)
- widget_input.set_size_request(0, 100)
+ widget_result.set_size_request(0, 50)
+ widget_input.set_size_request(0, 50)
widget_result.buffer.insert(widget_result.buffer.start_iter, "mikutter console.\n下にRubyコードを入力して、Ctrl+Enterを押すと、ここに実行結果が表示されます\n")
@@ -51,15 +54,17 @@ Plugin.create :console do
tab(:console, "コンソール") do
set_icon MUI::Skin.get('console.png')
set_deletable true
- nativewidget Gtk::Table.new(2, 3).
- attach(widget_result, 0, 1, 0, 1, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND).
- attach(scroll_result_h, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::FILL).
- attach(scroll_result_v, 1, 2, 0, 1, Gtk::FILL, Gtk::SHRINK|Gtk::FILL)
- shrink
- nativewidget Gtk::Table.new(2, 3).
- attach(widget_input, 0, 1, 0, 1, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND).
- attach(scroll_input_h, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::FILL).
- attach(scroll_input_v, 1, 2, 0, 1, Gtk::FILL, Gtk::SHRINK|Gtk::FILL)
+ nativewidget Plugin::Console::ConsoleControl.new().
+ pack1(Gtk::Table.new(2, 3).
+ attach(widget_result, 0, 1, 0, 1, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND).
+ attach(scroll_result_h, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::FILL).
+ attach(scroll_result_v, 1, 2, 0, 1, Gtk::FILL, Gtk::SHRINK|Gtk::FILL),
+ true, false).
+ pack2(Gtk::Table.new(2, 3).
+ attach(widget_input, 0, 1, 0, 1, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND, Gtk::FILL|Gtk::SHRINK|Gtk::EXPAND).
+ attach(scroll_input_h, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::FILL).
+ attach(scroll_input_v, 1, 2, 0, 1, Gtk::FILL, Gtk::SHRINK|Gtk::FILL),
+ false, false)
active!
end
end
diff --git a/core/plugin/console/console_control.rb b/core/plugin/console/console_control.rb
new file mode 100644
index 00000000..ef16ab38
--- /dev/null
+++ b/core/plugin/console/console_control.rb
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+
+module Plugin::Console
+ class ConsoleControl < Gtk::VPaned
+ def active
+ get_ancestor(Gtk::Window).set_focus(child2) if(get_ancestor(Gtk::Window))
+ end
+ end
+end
+
+
+
+