Skip to content

Commit 59647b8

Browse files
feat(ui): add tooltips for dash pattern, border fill fade, and name/emblem min/max size
1 parent 51556b8 commit 59647b8

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

src/renderer/src/intl/en-US.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ export default {
121121
smoothed: 'Smoothed',
122122
glow: 'Glow',
123123
dashed: 'Dashed',
124-
dash_pattern: 'Dash Pattern',
124+
dash_pattern: 'Pattern',
125+
dash_pattern_tooltip:
126+
'A space-separated list determining the length of dashes and gaps. For example, "3 1" is a 3-length dash followed by a 1-length gap. You can use longer lists for complex patterns.',
125127
},
126128
},
127129
},
@@ -250,6 +252,11 @@ export default {
250252
borderColor: 'Country Border Color',
251253
borderFillColor: 'Country Fill Color',
252254
borderFillFade: 'Country Fill Fade',
255+
borderFillFade_tooltip: `<ul>
256+
<li>Adds a fade-out effect at near the border.</li>
257+
<li>Starts at 100% opacity at the border.</li>
258+
<li>Works best if Country Fill Color has low opacity.</li>
259+
</ul>`,
253260
sectorBorderStroke: 'Sector Borders',
254261
sectorBorderColor: 'Sector Border Color',
255262
unionBorderStroke: 'Union Borders',
@@ -265,12 +272,18 @@ export default {
265272
countryNames: 'Names',
266273
countryNamesType: 'Name Type',
267274
countryNamesMinSize: 'Name Min Size',
275+
countryNamesMinSize_tooltip: 'If this size does not fit, the name is not drawn.',
268276
countryNamesMaxSize: 'Name Max Size',
277+
countryNamesMaxSize_tooltip:
278+
'The name will not be drawn bigger than this, even if there is room.',
269279
countryNamesSecondaryRelativeSize: 'Secondary Name Relative Size',
270280
countryNamesFont: 'Font',
271281
countryEmblems: 'Emblems',
272282
countryEmblemsMinSize: 'Emblem Min Size',
283+
countryEmblemsMinSize_tooltip: 'If this size does not fit, the emblem is not drawn.',
273284
countryEmblemsMaxSize: 'Emblem Max Size',
285+
countryEmblemsMaxSize_tooltip:
286+
'The emblem will not be drawn bigger than this, even if there is room.',
274287
labelsAvoidHoles: 'Avoid Holes in Border',
275288
systemNames: 'System Names',
276289
systemNamesFont: 'Font',

src/renderer/src/lib/SettingControl/StrokeSettingControl.svelte

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<script lang="ts">
2-
import { Accordion, AccordionItem } from '@skeletonlabs/skeleton';
2+
import { Accordion, AccordionItem, popup } from '@skeletonlabs/skeleton';
33
import { fade } from 'svelte/transition';
44
import { t } from '../../intl';
5+
import HeroiconInfoMini from '../icons/HeroiconInfoMini.svelte';
56
import type { SettingConfigStroke, StrokeSetting } from '../settings';
67
78
export let value: StrokeSetting;
@@ -96,6 +97,24 @@
9697
<label class="text-surface-300" for="{config.id}-dashArray" transition:fade>
9798
{$t('control.stroke.more_styles.dash_pattern')}
9899
</label>
100+
<button
101+
type="button"
102+
class="text-secondary-500-400-token ms-1 [&>*]:pointer-events-none"
103+
use:popup={{
104+
event: 'hover',
105+
target: `${config.id}-dash-pattern-tooltip`,
106+
placement: 'top',
107+
}}
108+
>
109+
<HeroiconInfoMini />
110+
</button>
111+
<div
112+
class="card variant-filled-secondary z-10 max-w-96 p-2 text-sm"
113+
data-popup="{config.id}-dash-pattern-tooltip"
114+
>
115+
{$t('control.stroke.more_styles.dash_pattern_tooltip')}
116+
<div class="variant-filled-secondary arrow" />
117+
</div>
99118
<input
100119
id="{config.id}-dashArray"
101120
type="text"

src/renderer/src/lib/settings/mapSettingsConfig.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [
3535
min: 0,
3636
max: 1,
3737
step: 0.05,
38+
tooltip: 'setting.borderFillFade_tooltip',
3839
},
3940
{
4041
id: 'sectorBorderStroke',
@@ -163,6 +164,7 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [
163164
name: 'option.country_names_type.player_then_country',
164165
},
165166
],
167+
hideIf: (settings) => !settings.countryNames,
166168
},
167169
{
168170
id: 'countryNamesMinSize',
@@ -172,6 +174,7 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [
172174
step: 1,
173175
optional: true,
174176
hideIf: (settings) => !settings.countryNames,
177+
tooltip: 'setting.countryNamesMinSize_tooltip',
175178
},
176179
{
177180
id: 'countryNamesMaxSize',
@@ -181,6 +184,7 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [
181184
step: 1,
182185
optional: true,
183186
hideIf: (settings) => !settings.countryNames,
187+
tooltip: 'setting.countryNamesMaxSize_tooltip',
184188
},
185189
{
186190
id: 'countryNamesSecondaryRelativeSize',
@@ -212,6 +216,7 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [
212216
step: 1,
213217
optional: true,
214218
hideIf: (settings) => !settings.countryEmblems,
219+
tooltip: 'setting.countryEmblemsMinSize_tooltip',
215220
},
216221
{
217222
id: 'countryEmblemsMaxSize',
@@ -221,6 +226,7 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [
221226
step: 1,
222227
optional: true,
223228
hideIf: (settings) => !settings.countryEmblems,
229+
tooltip: 'setting.countryEmblemsMaxSize_tooltip',
224230
},
225231
{
226232
id: 'labelsAvoidHoles',

0 commit comments

Comments
 (0)