-
Notifications
You must be signed in to change notification settings - Fork 1
/
nitgit.rb
70 lines (53 loc) · 1.59 KB
/
nitgit.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Shoes.setup do
source "http://gems.github.com"
gem "mojombo-grit"
end
%w(
grit
iconv
).each { |lib| require lib }
%w(
grit_extensions
settings
colors
repo_manager
pagination
).each { |support| require "lib/#{support}" }
# spinner
%w(
commit_list_item
labeled_check
).each { |widget| require "lib/#{widget}"}
APP_WIDTH = 900
COMMITS_WIDTH = 280
###
Shoes.app :title => "nitgit - git commit browser", :width => APP_WIDTH do
extend Settings, Colors, RepoManager, Pagination
background blue
stack :height => 36 do
background black
@menu = flow :margin => [7,7,7,0] do
para "nitgit", :font => "Century Gothic", :size => 16, :stroke => white, :margin => 0
button "open repo", :margin => 0, :displace_top => -4 do
open_repo ask_open_folder
end
@name = para "", :font => "Century Gothic", :stroke => blue, :margin => [0,4,6,0]
@branches = list_box :margin => [0,3,0,0], :displace_top => -4 do |b|
@selected_branch = b.text
load_repo
end
@hide_merges = labeled_check("hide merges",
:width => 100, :stroke => white, :size => base_font_size,
:checked => repo_settings[:hide_merges]) do
repo_settings[:hide_merges] = @hide_merges.checked?
save_settings!
load_repo @page
end
@pagination = flow :width => 200, :right => 5, :margin => 0, &method(:pagination_browse)
# @spinner = spinner
end
end
@commits = stack :width => COMMITS_WIDTH
@diffs = stack :width => -COMMITS_WIDTH-gutter
open_repo ask_open_folder
end