mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:17:45 +00:00
FontEditor: Add move glyph tool
When toggled on, glyphs can now be repositioned within the glyph editor by dragging the mouse
This commit is contained in:
parent
44cd121e30
commit
bada590b91
5 changed files with 101 additions and 8 deletions
|
@ -108,6 +108,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::BitmapFont>&&
|
|||
auto& toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar");
|
||||
auto& statusbar = *find_descendant_of_type_named<GUI::Statusbar>("statusbar");
|
||||
auto& glyph_map_container = *find_descendant_of_type_named<GUI::Widget>("glyph_map_container");
|
||||
auto& move_glyph_button = *find_descendant_of_type_named<GUI::Button>("move_glyph_button");
|
||||
m_glyph_editor_container = *find_descendant_of_type_named<GUI::Widget>("glyph_editor_container");
|
||||
m_left_column_container = *find_descendant_of_type_named<GUI::Widget>("left_column_container");
|
||||
m_glyph_editor_width_spinbox = *find_descendant_of_type_named<GUI::SpinBox>("glyph_editor_width_spinbox");
|
||||
|
@ -299,6 +300,15 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::BitmapFont>&&
|
|||
m_glyph_editor_scale_actions.add_action(*m_scale_fifteen_action);
|
||||
m_glyph_editor_scale_actions.set_exclusive(true);
|
||||
|
||||
move_glyph_button.on_click = [&] {
|
||||
if (move_glyph_button.is_checked())
|
||||
m_glyph_editor_widget->set_mode(GlyphEditorWidget::Move);
|
||||
else
|
||||
m_glyph_editor_widget->set_mode(GlyphEditorWidget::Paint);
|
||||
};
|
||||
move_glyph_button.set_checkable(true);
|
||||
move_glyph_button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/selection-move.png"));
|
||||
|
||||
GUI::Clipboard::the().on_change = [&](const String& data_type) {
|
||||
m_paste_action->set_enabled(data_type == "glyph/x-fonteditor");
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue