1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 23:37:14 +03:00

42 Commits

Author SHA1 Message Date
David Sangrey
080d9f98f2
[1812] Handover Translations 2024-04-22 17:33:28 -04:00
David Sangrey
1800f8f0b1
[2186] Remove Some Comments 2024-03-27 22:17:21 -04:00
David Sangrey
57cd75e75e
[2186] Additional Files 2024-03-27 19:39:51 -04:00
David Sangrey
b2d5e13465
[2051] Update Supporting Files
Not touching any of the big ones, but some clarification updates to many of the supporting files.
2023-11-17 11:33:26 -05:00
Athanasius
eaaa6fead0
Correctly type theme ui_scale variables
Technically `theme.startup_ui_scale` should be `float` to match with
`default_ui_scale` from tkinter, but we store it in the config as `int`,
so go with that.
2022-12-23 14:47:31 +00:00
Athanasius
777b38e179
theme.py: Minor typing fix 2022-12-23 14:47:10 +00:00
Athanasius
45043d9359
theme.py: Some more tk.BitmapImage guarding, but using isinstance()
`type(...)` is probably incorrect, and `isinstance(...)` gets mypy to take
account of subclasses properly.
2022-12-05 15:57:17 +00:00
Athanasius
09d632bb34
theme.py: Fix up some typing issues
We're passing around *either* tk.Widget *or* tk.BitmapImage in places, but
tk.BitmapImage really isn't the same.  It doesn't have some functions, can't
be treated as a Dict etc.
2022-12-05 15:57:16 +00:00
Athanasius
62e285b52e
themes: Use defined constants for which theme throughout
This has been relying on knowledge of the magic numbers for far too long.

As part of this, remove all the obfuscating "oh, default is 0, and we want
that or any other theme, so treat this like a boolean" nonsense.

Also, stop assuming that "> 1" is a synonym for "transparent theme".  Just
Do The Equality Check.
2022-12-05 15:57:15 +00:00
Athanasius
e4055530b4
theme: The very start of actually using defined constants for themes 2022-12-05 10:49:05 +00:00
Athanasius
0dbbb38821
theme.py: Just use 'dict' style configuration of widgets
It turns out that you don't need to call `.configure(keyword=...)` on tk
widgets.  You can just treat them as a dict with the available option as
a key.

This neatly gets rid of the type hint issues.
2022-12-03 17:50:47 +00:00
Athanasius
8728234625
theme.py: mypy pass
mypy/typeshed still doesn't like 'generic' tk arguments on things like
.configure(), so lots of `# type: ignore` used for those.
2022-12-03 17:36:10 +00:00
Athanasius
cc8e0bfd27
theme.py: flake8 pass
Conversion from %-format to f-string means an `assert ..., string`` is now
a condition and a `raise AssertionError(string)`.  The problem being that
f-string gets evaluated before the assert, but in this case the things the
f-string relies on are only there if the assert triggers.
2022-12-03 16:59:39 +00:00
Athanasius
520ff5868f
theme.py: Apply .configure() paranoia on button enter/leave 2022-02-20 19:05:41 +00:00
Athanasius
17530c2d2b
theme.py: Log widget if exception is thrown 2022-02-19 11:48:27 +00:00
Athanasius
10977ccb07
Prevent plugin widget code issues from breaking theme changes
This adds a try/except around a bunch of .configure() calls on widgets.
Yes, sure, this could then leave the widget in question in a broken state,
but at least our entire UI won't fall flat on its face.
2022-02-19 11:15:06 +00:00
A_D
bff6175ee7
Update to use sys.platform over platform 2022-01-26 18:51:49 +02:00
Athanasius
631446f619 Translations: Final LANG comments
The script now outputs nothing about Unknown comments
2021-06-07 16:02:39 +01:00
A_D
fe90f1f0b3
Cleaned up imports, removed incase imports
closes EDCD/EDMarketConnector#569
2021-05-28 14:46:51 +02:00
A_D
82db2e1a06 Removed star import from ctypes 2021-04-01 14:45:50 +01:00
Athanasius
25852997c5 Updated all source to use new config methods
# Conflicts:
#	monitor.py
2021-04-01 14:45:46 +01:00
Athanasius
cd24db88a9 UI Scaling: Size the Scale bar as per our startup value
If we use the last configured value then the width of the Scale bar
changes as per the user's last setting, even though they might not have
yet restarted for all the rest of the UI to resize.
2020-09-11 11:14:19 +01:00
Athanasius
1446796eb8 UI Scaling: Store pre-fiddling default in theme.default_ui_scale
This is in case anything needs to know the ratio between what was the
default and what we then set it to.
2020-09-09 16:18:23 +01:00
Athanasius
94a9a9b948 Pull X11 setup back out of function for 'dpy'.
'dpy' needs to be global, and there might be other side effects.  So
just revert to this code being global.
2020-07-09 08:32:35 +01:00
A_D
be98365fb3
Fix #568 with ENV var workaround
EDMC.py would break due to an import chain that ends up in theme. Theme
does a whole bunch of work to setup our GUI for EDMarketConnector.py,
but it does this on any import, which will fail spectacularly if there
is either no DISPLAY var set or no X11 libs available on our machine at
all (as a sidenote this means it probably also breaks on a wholly
wayland install).

This fixes the issue by adding a check for an environment variable on
import of theme. This can and WILL break if the env var is set and
EDMarketConnector.py is used, but if you do that its your own fault.
2020-07-08 17:55:54 +02:00
Athanasius
af9c44640f theme.py: Check if we can actually get an Xorg/X11 display
The added exception at least means we don't then segmentation fault in
the next line, but it also means we then hit another exception later
in the main loop as we try to create the main Tk window.

Hopefully the exception messages will be clear enough to the user.

closes #500
2020-07-04 09:37:50 +01:00
Jonathan Harris
a4f4483d20 Misc fixes for MacOS 2020-06-21 16:31:41 +01:00
Athanasius
2440cf4a67 platform is always just 'linux' under python3 2020-06-21 16:23:01 +01:00
Athanasius
6925abf93b theme.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
d0ae621387 Running EDMarketConnector.py 'works'.
First pass utilising 'futurize' to do most of the work.

  There's an issue with ur'\"' in l10n.py which I'm not sure how to
properly fix.

  This now has errors when hitting the 'Update' button.
2020-06-21 16:23:00 +01:00
Jonathan Harris
8c2775f6d8 Appear on task bar in dark mode on Linux
and so enable minimize button.
Maybe addresses #440
2019-09-30 17:35:22 +01:00
Jonathan Harris
b81c4cf6c5 More control over widget colors
Documented mechanism to apply theme to dynamically created widgets.
Allow widgets to override theme colors. Fixes #444
2019-09-24 00:08:46 +01:00
Jonathan Harris
630da89831 Increase transparent theme font size
Fixes #416
2019-09-22 18:52:07 +01:00
Jonathan Harris
2dd6c4d008 Support not always on top with dark theme on Linux
Fixes #421
2019-05-28 00:06:33 +01:00
Jonathan Harris
d373fd39aa Reduce transparent theme window size
Fixes #414
2019-05-02 00:08:27 +01:00
Jonathan Harris
3b321df6b0 Use "Euro Caps" font with transparent theme
Addresses #412
2019-04-07 14:56:58 +01:00
Jonathan Harris
9f776d5a20 Add separators between plugins in main window 2018-06-13 18:02:29 -05:00
Jonathan Harris
33b435e556 Fix vertical window resize on macOS
Disable zoom button on Windows and macOS.
2017-07-29 15:36:43 +01:00
Jonathan Harris
b794e19d75 Automatically highlight widgets that set a custom cursor 2017-07-29 14:41:59 +01:00
Jonathan Harris
e571e2860d Add Transparent theme on Windows 2017-01-30 15:40:34 +00:00
Jonathan Harris
b8db9a814e Make dark theme background off-black 2016-02-21 04:15:39 +00:00
Jonathan Harris
f0683926fd Dark theme
Fixes #84
2016-02-01 03:41:37 +00:00