Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akkiesoft/c44615b06711143648c027b085b4decb to your computer and use it in GitHub Desktop.
Save Akkiesoft/c44615b06711143648c027b085b4decb to your computer and use it in GitHub Desktop.
deprecated絶対殺すマン
diff --git a/core/mui/gtk_intelligent_textview.rb b/core/mui/gtk_intelligent_textview.rb
index 9d850c66..9df633c9 100644
--- a/core/mui/gtk_intelligent_textview.rb
+++ b/core/mui/gtk_intelligent_textview.rb
@@ -107,7 +107,7 @@ class Gtk::IntelligentTextview < Gtk::TextView
when String
type_strict fonts => Hash
tags = fonts2tags(fonts)
- buffer.insert(buffer.start_iter, msg, 'shell')
+ buffer.insert(buffer.start_iter, msg, {shell: ''})
apply_links
apply_inner_widget
when Enumerable # score
@@ -136,7 +136,7 @@ class Gtk::IntelligentTextview < Gtk::TextView
buffer.insert(pos, note.description)
buffer.apply_tag(tagname, buffer.get_iter_at_offset(start), pos)
else
- buffer.insert(pos, note.description, 'shell')
+ buffer.insert(pos, note.description, {shell: ''})
end
end
end
diff --git a/core/mui/gtk_tree_view_pretty_scroll.rb b/core/mui/gtk_tree_view_pretty_scroll.rb
index 2c53f9a4..e519af0c 100644
--- a/core/mui/gtk_tree_view_pretty_scroll.rb
+++ b/core/mui/gtk_tree_view_pretty_scroll.rb
@@ -22,10 +22,10 @@ module Gtk::TreeViewPrettyScroll
ssc(:scroll_event){ |this, e|
case e.direction
- when Gdk::EventScroll::UP
+ when Gdk::ScrollDirection::UP
this.vadjustment.value = [this.vadjustment.value - this.vadjustment.step_increment, this.vadjustment.lower].max
scroll_to_top_animation_id.call
- when Gdk::EventScroll::DOWN
+ when Gdk::ScrollDirection::DOWN
@scroll_to_zero_lator = false if this.vadjustment.value == 0
this.vadjustment.value = [this.vadjustment.value + this.vadjustment.step_increment, this.vadjustment.upper - visible_rect.height].min
scroll_to_top_animation_id.call end
diff --git a/plugin/bugreport/bugreport.rb b/plugin/bugreport/bugreport.rb
index 18ed9300..7818d859 100644
--- a/plugin/bugreport/bugreport.rb
+++ b/plugin/bugreport/bugreport.rb
@@ -15,15 +15,15 @@ Plugin.create :bugreport do
def popup
alert_thread = if(Thread.main != Thread.current) then Thread.current end
- dialog = Gtk::Dialog.new("bug report")
+ dialog = Gtk::Dialog.new(title: "bug report")
dialog.set_size_request(600, 400)
- dialog.window_position = Gtk::Window::POS_CENTER
- dialog.vbox.pack_start(main, true, true, 30)
+ dialog.window_position = Gtk::WindowPosition::CENTER
+ dialog.child.pack_start(main, expand: true, fill: true, padding: 30)
dialog.add_button(Gtk::Stock::OK, Gtk::ResponseType::OK)
dialog.add_button(Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL)
dialog.default_response = Gtk::ResponseType::OK
quit = lambda{
- dialog.hide_all.destroy
+ dialog.hide.destroy
Gtk.main_iteration_do(false)
if alert_thread
alert_thread.run
diff --git a/plugin/console/console.rb b/plugin/console/console.rb
index 4861f7f0..56209534 100644
--- a/plugin/console/console.rb
+++ b/plugin/console/console.rb
@@ -31,15 +31,15 @@ Plugin.create :console do
iter = widget_result.buffer.end_iter
begin
result = Kernel.instance_eval(widget.buffer.text)
- widget_result.buffer.insert(iter, ">>> ", "prompt")
- widget_result.buffer.insert(iter, "#{widget.buffer.text}\n", "echo")
- widget_result.buffer.insert(iter, "#{result.inspect}\n", "result")
+ widget_result.buffer.insert(iter, ">>> ", {prompt: "prompt"})
+ widget_result.buffer.insert(iter, "#{widget.buffer.text}\n", {echo: "echo"})
+ widget_result.buffer.insert(iter, "#{result.inspect}\n", {result: "result"})
rescue Exception => e
- widget_result.buffer.insert(iter, ">>> ", "prompt")
- widget_result.buffer.insert(iter, "#{widget.buffer.text}\n", "echo")
- widget_result.buffer.insert(iter, "#{e.class}: ", "errorclass")
- widget_result.buffer.insert(iter, "#{e}\n", "error")
- widget_result.buffer.insert(iter, e.backtrace.join("\n") + "\n", "backtrace")
+ widget_result.buffer.insert(iter, ">>> ", {prompt: "prompt"})
+ widget_result.buffer.insert(iter, "#{widget.buffer.text}\n", {echo: "echo"})
+ widget_result.buffer.insert(iter, "#{e.class}: ", {errorclass: "errorclass"})
+ widget_result.buffer.insert(iter, "#{e}\n", {error: "error"})
+ widget_result.buffer.insert(iter, e.backtrace.join("\n") + "\n", {backtrace: "backtrace"})
end
Delayer.new {
if not widget_result.destroyed?
@@ -52,17 +52,17 @@ Plugin.create :console do
set_icon Skin[:console]
set_deletable true
temporary_tab
- nativewidget Plugin::Console::ConsoleControl.new().
+ nativewidget Plugin::Console::ConsoleControl.new(:vertical).
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).
+ attach(widget_result, 0, 1, 0, 1, ::Gtk::AttachOptions::FILL|::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::EXPAND, ::Gtk::AttachOptions::FILL|::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::EXPAND).
+ attach(scroll_result_h, 0, 1, 1, 2, ::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::FILL, ::Gtk::AttachOptions::FILL).
+ attach(scroll_result_v, 1, 2, 0, 1, ::Gtk::AttachOptions::FILL, ::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::FILL),
+ resize: false, shrink: 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)
+ attach(widget_input, 0, 1, 0, 1, ::Gtk::AttachOptions::FILL|::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::EXPAND, ::Gtk::AttachOptions::FILL|::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::EXPAND).
+ attach(scroll_input_h, 0, 1, 1, 2, ::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::FILL, ::Gtk::AttachOptions::FILL).
+ attach(scroll_input_v, 1, 2, 0, 1, ::Gtk::AttachOptions::FILL, ::Gtk::AttachOptions::SHRINK|::Gtk::AttachOptions::FILL),
+ resize: false, shrink: false)
active!
end
end
@@ -73,8 +73,11 @@ Plugin.create :console do
# ==== Return
# 縦スクロールバーと横スクロールバー
def gen_scrollbars(widget)
- scroll_v = ::Gtk::VScrollbar.new
- scroll_h = ::Gtk::HScrollbar.new
+ #scroll_v = ::Gtk::VScrollbar.new
+ #scroll_h = ::Gtk::HScrollbar.new
+ scroll_v = Gtk::Scrollbar.new(:vertical)
+ scroll_h = Gtk::Scrollbar.new(:horizontal)
+ # FIXME: gtk3
widget.set_scroll_adjustment(scroll_h.adjustment, scroll_v.adjustment)
return scroll_v, scroll_h
end
diff --git a/plugin/console/console_control.rb b/plugin/console/console_control.rb
index ef16ab38..f1302f34 100644
--- a/plugin/console/console_control.rb
+++ b/plugin/console/console_control.rb
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
module Plugin::Console
- class ConsoleControl < Gtk::VPaned
+ class ConsoleControl < Gtk::Paned
def active
get_ancestor(Gtk::Window).set_focus(child2) if(get_ancestor(Gtk::Window))
end
diff --git a/plugin/gtk3/widget/worldshifter.rb b/plugin/gtk3/widget/worldshifter.rb
index 5fdb3048..eaec11f4 100644
--- a/plugin/gtk3/widget/worldshifter.rb
+++ b/plugin/gtk3/widget/worldshifter.rb
@@ -24,16 +24,16 @@ class Plugin::Gtk3::WorldShifter < Gtk::EventBox
def open_menu(event)
@menu ||= Gtk::Menu.new.tap do |menu|
Plugin.collect(:worlds).each do |world|
- item = Gtk::ImageMenuItem.new(world.title, false)
+ item = Gtk::ImageMenuItem.new(label: world.title, accel_group: false)
item.set_image Gtk::WebIcon.new(world.icon, UserConfig[:gtk_accountbox_geometry], UserConfig[:gtk_accountbox_geometry])
item.ssc(:activate) { |w|
Plugin.call(:world_change_current, world)
- @face.tooltip(world.title)
+ @face.tooltip_text = world.title
false }
menu.append item
end
menu.append Gtk::SeparatorMenuItem.new
- item = Gtk::ImageMenuItem.new(Plugin[:gtk3]._('Worldを追加'), false)
+ item = Gtk::ImageMenuItem.new(label: Plugin[:gtk3]._('Worldを追加'), accel_group: false)
item.set_image Gtk::WebIcon.new(Skin[:add], UserConfig[:gtk_accountbox_geometry], UserConfig[:gtk_accountbox_geometry])
item.ssc(:activate) { |w|
Plugin.call(:request_world_add)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment