1+ --[[
2+
3+ UIHelpers.lua
4+
5+ UI Helper Functions for Piwigo Publisher plugin
6+
7+ Copyright (C) 2024 Fiona Boston <fiona@fbphotography.uk>.
8+
9+ This file is part of PiwigoPublish
10+
11+ This program is free software: you can redistribute it and/or modify
12+ it under the terms of the GNU General Public License as published by
13+ the Free Software Foundation; either version 3 of the License, or
14+ (at your option) any later version.
15+
16+ This program is distributed in the hope that it will be useful,
17+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+ GNU General Public License for more details.
20+
21+ You should have received a copy of the GNU General Public License
22+ along with this program. If not, see <http://www.gnu.org/licenses/>.
23+ ]]
24+
25+ UIHelpers = {}
26+
27+ -- *************************************************
28+ -- Create plugin header with icon and version information
29+ -- Returns a row containing icon + plugin name + version
30+ -- *************************************************
31+ function UIHelpers .createPluginHeader (f , share , iconPath , pluginVersion )
32+ local INDENT_PIXELS = 14
33+
34+ return f :row {
35+ f :picture {
36+ alignment = ' left' ,
37+ value = iconPath ,
38+ },
39+ f :column {
40+ spacing = f :control_spacing (),
41+ f :spacer { height = 1 },
42+ f :row {
43+ f :spacer { width = INDENT_PIXELS },
44+ f :static_text {
45+ title = " Piwigo Publisher Plugin" ,
46+ font = " <system/bold>" ,
47+ alignment = ' left' ,
48+ width = share ' labelWidth' ,
49+ },
50+ },
51+ f :row {
52+ f :spacer { width = INDENT_PIXELS },
53+ f :static_text {
54+ title = " Plugin Version" ,
55+ alignment = ' left' ,
56+ },
57+ f :static_text {
58+ title = pluginVersion ,
59+ alignment = ' left' ,
60+ width = share ' labelWidth' ,
61+ },
62+ },
63+ },
64+ }
65+ end
66+
67+ return UIHelpers
0 commit comments