Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-panel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-panel
Commits
92d9e190
Verified
Commit
92d9e190
authored
Jun 20, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panel: add end margin option
parent
269c5d7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
14 deletions
+30
-14
README.md
README.md
+8
-0
config.json
data/config.json
+1
-0
config.go
src/config.go
+5
-0
generate.go
src/generate.go
+16
-14
No files found.
README.md
View file @
92d9e190
...
...
@@ -75,6 +75,14 @@ Module spacing:
}
```
End margins for floating and island panels:
```
json
{
"end_margin"
:
8
}
```
## Module Resolution
The config stores logical module names. At generation time, the panel merges
...
...
data/config.json
View file @
92d9e190
...
...
@@ -3,6 +3,7 @@
"type"
:
"panel"
,
"output"
:
[],
"spacing"
:
10
,
"end_margin"
:
8
,
"modules_left"
:
[
"image#menu"
,
"tray"
...
...
src/config.go
View file @
92d9e190
...
...
@@ -22,6 +22,7 @@ type Config struct {
Type
string
`json:"type"`
Output
[]
string
`json:"output"`
Spacing
int
`json:"spacing"`
EndMargin
int
`json:"end_margin"`
ModulesLeft
[]
string
`json:"modules_left"`
ModulesCenter
[]
string
`json:"modules_center"`
ModulesRight
[]
string
`json:"modules_right"`
...
...
@@ -88,6 +89,10 @@ func (c Config) Validate() error {
return
errors
.
New
(
"spacing cannot be negative"
)
}
if
c
.
EndMargin
<
0
{
return
errors
.
New
(
"end margin cannot be negative"
)
}
for
_
,
name
:=
range
append
(
append
([]
string
{},
c
.
ModulesLeft
...
),
append
(
c
.
ModulesCenter
,
c
.
ModulesRight
...
)
...
)
{
if
strings
.
TrimSpace
(
name
)
==
""
{
return
errors
.
New
(
"module name cannot be empty"
)
...
...
src/generate.go
View file @
92d9e190
...
...
@@ -35,7 +35,7 @@ func GenerateConfig(cfg Config, registry Registry) ([]byte, error) {
}
if
cfg
.
Type
==
"floating"
||
cfg
.
Type
==
"islands"
{
applyFloatingMargins
(
out
,
cfg
.
Position
)
applyFloatingMargins
(
out
,
cfg
.
Position
,
cfg
.
EndMargin
)
}
left
,
err
:=
resolveModuleList
(
cfg
.
ModulesLeft
,
cfg
.
Position
,
registry
)
...
...
@@ -62,24 +62,26 @@ func GenerateConfig(cfg Config, registry Registry) ([]byte, error) {
return
append
(
data
,
'\n'
),
nil
}
func
applyFloatingMargins
(
out
map
[
string
]
any
,
position
string
)
{
func
applyFloatingMargins
(
out
map
[
string
]
any
,
position
string
,
endMargin
int
)
{
const
edgeMargin
=
8
switch
position
{
case
"top"
:
out
[
"margin-top"
]
=
8
out
[
"margin-left"
]
=
8
out
[
"margin-right"
]
=
8
out
[
"margin-top"
]
=
edgeMargin
out
[
"margin-left"
]
=
endMargin
out
[
"margin-right"
]
=
endMargin
case
"bottom"
:
out
[
"margin-bottom"
]
=
8
out
[
"margin-left"
]
=
8
out
[
"margin-right"
]
=
8
out
[
"margin-bottom"
]
=
edgeMargin
out
[
"margin-left"
]
=
endMargin
out
[
"margin-right"
]
=
endMargin
case
"left"
:
out
[
"margin-
top"
]
=
8
out
[
"margin-
bottom"
]
=
8
out
[
"margin-
left"
]
=
8
out
[
"margin-
left"
]
=
edgeMargin
out
[
"margin-
top"
]
=
endMargin
out
[
"margin-
bottom"
]
=
endMargin
case
"right"
:
out
[
"margin-
top"
]
=
8
out
[
"margin-
bottom"
]
=
8
out
[
"margin-
right"
]
=
8
out
[
"margin-
right"
]
=
edgeMargin
out
[
"margin-
top"
]
=
endMargin
out
[
"margin-
bottom"
]
=
endMargin
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment