Skip to content

Commit

Permalink
Merge pull request #4 from tuttza/dev/enable_password_textfields
Browse files Browse the repository at this point in the history
Dev/enable password textfields
  • Loading branch information
tuttza authored Aug 22, 2021
2 parents 3bb582a + 2741185 commit 2ed0d16
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/mittens_ui/textbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ def initialize(options={})
@textbox = Gtk::Entry.new
can_edit = options[:can_edit].nil? ? true : options[:can_edit]
max_length = options[:max_length].nil? ? 200 : options[:max_length]

has_password = options[:password].nil? ? false : options[:password]

placeholder_text = options[:placeholder] || ""

if has_password
@textbox.set_visibility(false)
end

@textbox.set_editable(can_edit) unless can_edit.nil?
@textbox.set_max_length(max_length) unless max_length.nil?
@textbox.set_placeholder_text(placeholder_text)
Expand Down

0 comments on commit 2ed0d16

Please sign in to comment.