プロジェクト

全般

プロフィール

機能 #1197 » 1197-2.patch

Yuto Tokunaga, 2018-04-07 01:42

差分を表示:

core/mui/cairo_miracle_painter.rb
177 177
  def point_moved(x, y)
178 178
    point_moved_main_icon(x, y)
179 179
    signal_emit(:motion_notify_event, x, y)
180
    textselector_select(*main_pos_to_index_forclick(x, y)[1..2]) end
180
    textselector_select(*main_pos_to_index_forclick(x, y)[1..2])
181

  
182
    # change cursor shape
183
    index = main_pos_to_index(x, y)
184
    cursor_name = if index # the cursor is placed on text
185
                    if message.links.respond_to?(:segment_by_index) \
186
                        && message.links.segment_by_index(index)
187
                      # the cursor is placed on link
188
                      'pointer'
189
                    else
190
                      'text'
191
                    end
192
                  else
193
                    'default'
194
                  end
195
    window = @tree.get_ancestor Gtk::Window
196
    display = window.screen.display
197
    cursor = Gdk::Cursor.new display, cursor_name
198
    window.window.cursor = cursor
199
  end
181 200

  
182 201
  # leaveイベントを発生させる
183 202
  def point_leaved(x, y)
184 203
    iob_main_leave
185 204
    signal_emit(:leave_notify_event)
186 205
    # textselector_release
206

  
207
    # restore cursor shape
208
    window = @tree.get_ancestor Gtk::Window
209
    display = window.screen.display
210
    cursor = Gdk::Cursor.new display, 'default'
211
    window.window.cursor = cursor
187 212
  end
188 213

  
189 214
  # MiraclePainterが選択解除されたことを通知する
(2-2/2)