Skip to content

Commit

Permalink
Application uses globally shared icons now (Ticket #370)
Browse files Browse the repository at this point in the history
  • Loading branch information
GarstgerUnhold committed Oct 28, 2010
1 parent 3530901 commit 9e1d0d9
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion plugins/application/lib/application/speedbar.rb
Expand Up @@ -20,7 +20,7 @@ def self.append_item(item)
end

def self.close_image_path
File.join(Redcar.root, %w(plugins application icons close.png))
File.join(Redcar::ICONS_DIRECTORY, "/close.png")
end

def self.define_item_finder(name)
Expand Down
6 changes: 2 additions & 4 deletions plugins/application_swt/lib/application_swt/icon.rb
Expand Up @@ -24,13 +24,11 @@ def self.cached_images
end

def self.dir_image
path = File.join(Redcar.root, %w(plugins application icons darwin-folder.png))
image(path)
swt_image(:darwin_folder)
end

def self.file_image
path = File.join(Redcar.root, %w(plugins application icons darwin-file.png))
image(path)
swt_image(:darwin_file)
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions plugins/application_swt/lib/application_swt/tab.rb
Expand Up @@ -4,8 +4,6 @@ class Tab

attr_reader :item, :model, :notebook, :widget

FILE_ICON = File.join(Redcar.root, %w(plugins application lib application assets file.png))

def initialize(model, notebook, position = nil)
@model, @notebook = model, notebook
create_item_widget(position || @notebook.tab_folder.item_count)
Expand Down
30 changes: 12 additions & 18 deletions plugins/application_swt/lib/application_swt/window.rb
Expand Up @@ -138,32 +138,26 @@ def refresh_menu
end

def refresh_toolbar
if Redcar.app.show_toolbar?
@toolbar_controller = ApplicationSWT::ToolBar.new(self, Redcar.app.main_toolbar, Swt::SWT::HORIZONTAL | Swt::SWT::BORDER)
@toolbar_controller.show()
@toolbar_height = @toolbar_controller.height.to_i
else
@toolbar_controller.hide() if @toolbar_controller
@toolbar_height = 0
end
reset_sash_height
if Redcar.app.show_toolbar?
@toolbar_controller = ApplicationSWT::ToolBar.new(self, Redcar.app.main_toolbar, Swt::SWT::HORIZONTAL | Swt::SWT::BORDER)
@toolbar_controller.show()
@toolbar_height = @toolbar_controller.height.to_i
else
@toolbar_controller.hide() if @toolbar_controller
@toolbar_height = 0
end
reset_sash_height
end

def set_icon
path = File.join(icon_dir, icon_file)
icon = Swt::Graphics::Image.new(ApplicationSWT.display, path)
shell.image = icon
end

def icon_dir
File.join(Redcar.root, %w(plugins application icons))
shell.image = Icon.swt_image(icon_file)
end

def icon_file
if Redcar::VERSION =~ /dev$/
"redcar_icon_beta_dev.png"
:redcar_icon_beta_dev
else
"redcar_icon_beta.png"
:redcar_icon_beta
end
end

Expand Down
2 changes: 1 addition & 1 deletion plugins/swt/lib/swt.rb
Expand Up @@ -47,7 +47,7 @@ def initialize(max)
end

def show
@image = Swt::Graphics::Image.new(Swt.display, File.dirname(__FILE__) + "/../../application/icons/redcar-splash.png")
@image = Swt::Graphics::Image.new(Swt.display, Redcar::ICONS_DIRECTORY + "/redcar-splash.png")
@splash = Swt::Widgets::Shell.new(Swt::SWT::NONE)
@bar = Swt::Widgets::ProgressBar.new(@splash, Swt::SWT::NONE)
@bar.setMaximum(max)
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 9e1d0d9

Please sign in to comment.