Class: PdfParadise::GUI::Gtk::Controller
- Inherits:
-
Gtk::Box
- Object
- Gtk::Box
- PdfParadise::GUI::Gtk::Controller
show all
- Includes:
- Gtk::BaseModule
- Defined in:
- lib/pdf_paradise/gui/gtk3/controller/controller.rb
Overview
PdfParadise::GUI::Gtk::Controller
Constant Summary
collapse
- NAMESPACE =
inspect
- TITLE =
'.pdf-related actions'
- WIDTH =
1400
- HEIGHT =
1000
- USE_THIS_FONT =
:dejavu_condensed_22
Class Method Summary
collapse
-
.run(i = ARGV) ⇒ Object
# === PdfParadise::GUI::Gtk::Controller.run ========================================================================= #.
Instance Method Summary
collapse
Constructor Details
#initialize(commandline_arguments = ARGV, run_already = true) ⇒ Controller
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 56
def initialize(
commandline_arguments = ARGV,
run_already = true
)
super(:horizontal)
reset
set_commandline_arguments(
commandline_arguments
)
run if run_already
end
|
Class Method Details
.run(i = ARGV) ⇒ Object
#
PdfParadise::GUI::Gtk::Controller.run
#
199
200
201
202
203
204
205
206
207
208
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 199
def self.run(
i = ARGV
)
require 'gtk_paradise/run'
_ = ::PdfParadise::GUI::Gtk::Controller.new(i)
r = ::Gtk.run
r << _
r.automatic_size_then_automatic_title
r.top_left_then_run
end
|
Instance Method Details
#border_size? ⇒ Boolean
117
118
119
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 117
def border_size?
0
end
|
#connect_skeleton ⇒ Object
#
connect_skeleton (connect tag)
#
182
183
184
185
186
187
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 182
def connect_skeleton
abort_on_exception
minimal(
@notebook
)
end
|
#create_skeleton ⇒ Object
#
create_skeleton (create tag)
#
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 130
def create_skeleton
@notebook = gtk_notebook
tab_title = 'Statistics Widget'
@notebook.add_tab(
PdfParadise::GUI::Gtk::StatisticsWidget.new, title: tab_title
)
tab_title = 'Remove the first page of a .pdf file'
@notebook.add_tab(
::PdfParadise.return_widget_remove_first_page_of_pdf_file,
title: tab_title
)
tab_title = 'convert to .pdf'
@notebook.add_tab(
::PdfParadise::GUI::Gtk::ToPdf.new,
title: tab_title
)
tab_title = 'Split .pdf files'
@notebook.add_tab(
PdfParadise::GUI::Gtk::SplitPdfFile.new, title: tab_title
)
tab_title = 'pdf-viewer'
@notebook.add_tab(
PdfParadise::GUI::Gtk::PdfViewer.new, title: tab_title
)
end
|
#handle_CSS ⇒ Object
97
98
99
100
101
102
103
104
105
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 97
def handle_CSS
use_gtk_paradise_project_css_file
apply_these_CSS_rules 'tooltip {
font-size: 24px;
padding: 12px;
margin: 12px;
border: 3px dotted steelblue;
}'
end
|
#padding? ⇒ Boolean
110
111
112
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 110
def padding?
0
end
|
#reset ⇒ Object
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 71
def reset
reset_the_internal_variables
@configuration = [true, __dir__, NAMESPACE]
@title = TITLE
set_width(WIDTH)
set_height(HEIGHT)
set_use_this_font(USE_THIS_FONT)
handle_CSS
infer_the_size_automatically
end
|
#run ⇒ Object
192
193
194
|
# File 'lib/pdf_paradise/gui/gtk3/controller/controller.rb', line 192
def run
create_skeleton_then_connect_skeleton
end
|