Commit graph

181 commits

Author SHA1 Message Date
networkException
4230dbbb21 AK+Everywhere: Replace "protocol" with "scheme" url helpers
URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
2022-09-29 09:39:04 +01:00
Timothy Flynn
fc8bf7ac3e LibUnicode+Userland: Migrate generated CLDR data to LibLocaleData
Currently, LibUnicodeData contains the generated UCD and CLDR data. Move
the UCD data to the main LibUnicode library, and rename LibUnicodeData
to LibLocaleData. This is another prepatory change to migrate to
LibLocale.
2022-09-05 14:37:16 -04:00
thankyouverycool
0d4fd4e2a6 LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindows
with the RenderAbove WindowMode. This mode will ensure child
windows always draw above their parents, even when focus is lost.
RenderAbove modals are automatically themed the same as the old
ToolWindows. Fixes ToolWindows rendering above ALL normal windows,
regardless of parent. We can't rely on WindowType to create these
sort of effects because of WindowManager's strict display hierarchy.
2022-08-25 13:28:50 +02:00
Sam Atkins
ca0e32e59f FontEditor: Mark pasted glyphs as modified
Co-authored-by: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com>
2022-08-14 13:59:19 +01:00
Sam Atkins
5b7168b247 FontEditor: Add an option to show or hide modification highlights 2022-08-14 13:59:19 +01:00
Sam Atkins
7f6bf8c7c1 FontEditor: Store glyph modified state on the undo stack
This means that if you modify a glyph, then undo that modification, we
stop showing the glyph as modified.
2022-08-14 13:59:19 +01:00
thankyouverycool
a808cfa75c LibGUI+Applications: Govern Splitter resizing by opportunistic growth
This patch replaces the concept of fixed resizees with opportunistic
ones which use the new SpecialDimension::OpportunisticGrow UISize.
This lets us simplify splitter resize code and take advantage of
the layout system's automatic calculations for minimum size and
expansion. Functionally the same as before, but fixes Splitter's
unintended ability to grow window size.
2022-08-05 13:54:18 +02:00
thankyouverycool
7537a045e5 Applications: Make a few of the larger Toolbars collapsible
Some Toolbars for FileManager, FontEditor and PixelPaint can now
collapse on resize.
2022-08-04 02:56:17 +02:00
thankyouverycool
407231f11c FontEditor: Move new font creation to NewFontDialog and handle errors
Fixes potential OOM crashes when creating a new font and an oversight
in which glyph spacing was not being set.
2022-08-04 02:54:00 +02:00
thankyouverycool
807bd6da6c FontEditor: Improve error handling opening, saving and editing fonts
Adds fallible functions for opening and saving fonts and cutting
and copying selections. FontEditor now falls back on a guaranteed
default BitmapFont on startup. Fixes crashing on start when the
default system font is set to TrueType.
2022-08-04 02:54:00 +02:00
thankyouverycool
e9a150c87c FontEditor: Add show_error() helper 2022-08-04 02:54:00 +02:00
thankyouverycool
c044a556db FontEditor: Let editor recover from failed initializations
Fail early during font initialization and leave the editor in a
valid state in case of errors during UndoSelection creation.
2022-08-04 02:54:00 +02:00
sin-ack
c8585b77d2 Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
thankyouverycool
69a385f559 FontEditor: Rename FontEditorWidget => FontEditor::MainWidget 2022-07-06 14:25:30 +02:00
thankyouverycool
dcf6454059 FontEditor: Hide Widget::set_font() in GlyphEditorWidget
We were already doing the same for its getters, and this makes its
API more consistent with GlyphMapWidget.
2022-07-06 14:25:30 +02:00
thankyouverycool
bae36a7264 FontEditor: Remove unused headers and member variables 2022-07-06 14:25:30 +02:00
thankyouverycool
2227f8f8ae FontEditor: Simplify GlyphMapWidget context menu construction 2022-07-06 14:25:30 +02:00
thankyouverycool
dc3ee84aca FontEditor: Update GML for new layout system
This patch removes deprecated GML properties and manual sizing
calculations in favor of the new UIDimensions, and registers more
widgets in the FontEditor namespace to simplify widget setup.
2022-07-06 14:25:30 +02:00
thankyouverycool
1b9dff5fb1 FontEditor: Convert preview window to GML and propagate its errors 2022-07-06 14:25:30 +02:00
thankyouverycool
7376c68652 FontEditor: Propagate errors when pushing undo commands 2022-07-06 14:25:30 +02:00
thankyouverycool
ae333fad98 FontEditor: Normalize GlyphMap selection before creating UndoSelection
Fixes bogus indexing crashes when creating new restore states.
2022-07-06 14:25:30 +02:00
thankyouverycool
9962a744eb FontEditor: Improve error propagation during construction
FontEditor now builds its actions, toolbars, models and menus
with fallible methods. Widget assignment from GML is now organized
in order of use.
2022-07-06 14:25:30 +02:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
thankyouverycool
b8cc18896f LibGUI+FontEditor: Add context menu for editor actions
GlyphMapWidget now reports context menu requests when secondary
clicking the map. This also adds a new Select All action and updates
the Copy Character action to work on multi-glyph selections. Glyph
navigation actions have been moved to a separate Go menu, as is
common in other apps.
2022-03-20 20:00:25 +01:00
thankyouverycool
42284a1550 FontEditor: Change flip action shortcuts to Ctrl+Shift+{Q,W}
To not interfere with the command palette.
2022-03-20 20:00:25 +01:00
thankyouverycool
cdd1bc64f6 FontEditor: Set width on copy only if source glyph is present
Fixes empty glyphs copying as present in fixed-width fonts.
2022-03-20 20:00:25 +01:00
thankyouverycool
212817ea20 FontEditor: Restore selections on undo/redo actions
This makes navigating undo history a lot easier to follow.
Individual glyph alterations now reset selection size if necessary
to save space.
2022-03-20 20:00:25 +01:00
thankyouverycool
ab86294660 FontEditor: Reset unicode block view on undo/redo actions
If the previous active glyph is outside the currently selected
block range, reset GlyphMap to show all glyphs. This is less
disorienting when undoing changes outside the visible range.
2022-03-18 01:12:26 +01:00
thankyouverycool
a3956da6dc FontEditor: Make undo/redo compatible with multi-glyph selections
Previously the glyph undo stack saved an array of bytes representing
the restore state of an individual glyph when modified. Now the
selection undo stack saves a byte buffer of the entire selection,
letting us restore changes to multiple glyphs at once.
2022-03-18 01:12:26 +01:00
thankyouverycool
17b16f3997 FontEditor: Use memset/memcpy to copy/paste/delete glyphs
Iterating over each glyph to set bits was rather slow in large
selections. This lets us edit the entire character set almost
instantly.
2022-03-18 01:12:26 +01:00
electrikmilk
056ca62778 FontEditor: Add code previews for fixed-width fonts
Add pseudo code to font preview for fixed-width programming fonts.
2022-03-05 21:24:25 +01:00
Karol Kosek
cef595aa5c CharacterMap+FontEditor: Switch current Unicode block on arrow press 2022-03-04 11:53:04 -05:00
Lenny Maiorani
064cfd6cb7 Applications: Fix undefined behavior capturing non-static constexpr 2022-03-02 22:01:58 -08:00
Lenny Maiorani
1dd70a6f49 Applications: Change static constexpr variables to constexpr
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.
2022-02-28 13:54:27 +01:00
thankyouverycool
c3ce562240 LibGUI+Apps: Let Splitters select which resizee to set fixed
This gives Splitters more versatility when the right resizee is
intended to remain fixed or be toggled on and off.
2022-02-23 18:56:22 +02:00
thankyouverycool
cd4c11ebaf FontEditor: Remove listener client
FontEditor was relying on a hack to get notified about i32 config
changes, and scale is not a setting we want updated across all
editor instances, nor do we have any settings that make sense to
monitor universally, so let's remove listener privileges for now.
2022-02-18 07:38:29 -05:00
thankyouverycool
0d29419ed4 FontEditor: Save settings for showing metadata and unicode blocks 2022-02-18 07:38:29 -05:00
thankyouverycool
0061af170f FontEditor: Add a search box to filter Unicode blocks 2022-02-18 07:38:29 -05:00
Idan Horowitz
a8e329461f Applications: Run gml-format 2022-02-15 19:33:46 +02:00
thankyouverycool
aefb2bcf43 FontEditor: Add a ListView to sort glyphs by their Unicode block 2022-02-15 10:13:19 -05:00
Lenny Maiorani
160bda7228 Applications: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-14 22:06:55 +00:00
Idan Horowitz
c8ab45e79f Userland: Run gml-format
This brings the existing GML files up to spec with the new requirements
2022-02-13 02:36:35 +02:00
Vitaly Dyachkov
32b8795091 LibConfig: Rename pledge_domains(String) => pledge_domain(String)
pledge_domains() that takes only one String argument was specifically
added as a shortcut for pledging a single domain. So, it makes sense to
use singular here.
2022-02-11 18:06:39 +01:00
kleines Filmröllchen
6ee597369d Meta+Userland: Run the GML formatter on CI and pre-commit
Now that the GML formatter is both perserving comments and also mostly
agrees to the existing GML style, it can be used to auto-format all the
GML files in the system. This commit does not only contain the scripts
for running the formatting on CI and the pre-commit hook, but also
initially formats all the existing GML files so that the hook is
successfull.
2022-02-07 18:39:50 +01:00
Timothy Flynn
d51d5f9591 FontEditor: Retrieve code point abbreviations from LibUnicode
Rather than using a hard-coded list from AK::UnicodeUtils, LibUnicode
contains the up-to-date official names and contains abbreviations for
more control code points.
2022-01-18 15:13:25 +00:00
thankyouverycool
c094bb60bc FontEditor: Set GlyphEditor glyph on initialization
Fixes GlyphEditor appearing blank on start and subsequent
re-initializations.
2022-01-16 21:36:39 +01:00
thankyouverycool
8f60ea4470 FontEditor: Disambiguate save function from save-as action 2022-01-16 21:36:39 +01:00
thankyouverycool
c2b7bbbb2c FontEditor: Update GlyphEditor and width widgets on paste and delete
Fixes unsynced state between widgets after paste and delete actions.
2022-01-16 21:36:39 +01:00