This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Teacup::Stylesheet.new(:iphone) do | |
| # enable orientations on the root view | |
| style do | |
| left 0 | |
| top 0 | |
| width 320 | |
| height 480 | |
| backgroundColor :lightyellow.uicolor | |
| portrait true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def color_with(value=nil, options={}) | |
| if options.is_a?(Numeric) | |
| alpha = options.to_f | |
| else | |
| alpha = options.delete(:alpha) || 1 | |
| end | |
| if value | |
| if (value.is_a?(String) && value[0] == "#") | |
| value = value.gsub("#", "").to_i(16) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Inline styles | |
| @calculate_button = UIButton.named(I18n.t(:calculate_button)).style(color: 0xFFFFFF, align: :center, vertical_align: :center, top: 10, left: 30, width: 120, height: 40) | |
| # External styles | |
| # /app/stylesheets/application.rb | |
| class ApplicationStylesheet < Stylesheets::Base | |
| # Stylesheets for UI-Elements | |
| # usage: @element.outfit(:awesome_default) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Inline styles | |
| @calculate_button = UIButton.named(I18n.t(:calculate_button)).style(color: 0xFFFFFF, align: :center, vertical_align: :center, top: 10, left: 30, width: 120, height: 40) | |
| # External styles | |
| # /app/stylesheets/application.rb | |
| class ApplicationStylesheet < Stylesheets::Base | |
| # Stylesheets for UI-Elements | |
| # usage: @element.outfit(:awesome_default) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def convert_to_previews(new_file) | |
| name = File.basename(current_path) | |
| images = Magick::Image.read(current_path) do | |
| self.background_color = "white" # does not work for me :/ | |
| end | |
| if images.length > 0 | |
| save_path = "#{Rails.root}/public/uploads/#{model.class.to_s.underscore}/file/#{model.id}/slides" |
NewerOlder