Commit Graph

23 Commits

Author SHA1 Message Date
David Capello
684d06ede8 Merge branch 'main' into beta 2022-05-23 18:04:55 -03:00
David Capello
1366a6948c Fix performance issues adding/deleting widgets (related to #3281) 2022-05-20 11:03:12 -03:00
David Capello
a4fc3735c7 Fix crash setting theme in certain cases
Mainly when changing ui::View children (where a view changes its
children onInitTheme() function, e.g. adding/removing scrollbar).
2021-05-22 14:18:14 -03:00
David Capello
661f4897b2 Check that we're in the UI thread when modifying the widgets collection 2020-10-20 12:54:56 -03:00
David Capello
f223d157fd Fix crash dragging the mouse in the toolbar
If we pressed the mouse button in the toolbar and start moving the mouse
like crazy just to create/destroy the toolbar popup multiple times, it
reached a situation where the Manager's mouse_widget was equal to a
deleted widget (and mouse_widgets_list contained that widget too),
producing a crash when we tried to access it.
2017-09-04 18:10:02 -03:00
David Capello
432eedcb97 Support changing theme and UI scaling w/o restart (fix #471) 2017-08-15 10:39:06 -03:00
David Capello
94dcfa7f35 Fix ColorButton font
- We've added a new "font" attribute in <style>s elements.
- Fonts aren't reset when we refresh the theme. This must be fixed in a future version when the theme can be completely reloaded.
2017-03-08 18:53:36 -03:00
David Capello
6c9c0066a0 Replace ui::CurrentTheme with ui::set/get_theme() 2017-02-08 14:50:58 -03:00
David Capello
e8abba1b93 Refactor some UI code
- Moved ui::GuiSystem from ui/base.h to ui/system.h as ui::UISystem
- Moved some internals to ui::details namespace
- Fix crash of UI tests when ~Manager is called
- Removed ui::init/exit_system() functions
2015-09-01 10:18:47 -03:00
David Capello
325e9245bf Rename ui::Widget::type -> m_type and make it private 2015-06-23 14:37:22 -03:00
David Capello
0517cd1b98 Remove _ji_ prefix in some ui-lib functions 2015-06-23 14:14:06 -03:00
David Capello
eeb6d6e1b5 Fix problem resetting fonts after F5 for widgets with "mini font" (after theme is reloaded)
There are some widgets (e.g. fg/bg color buttons in the ColorBar, and
ContextBar's check-boxes) that use a "mini font". We could setup the mini
font in onInitTheme(), but the whole program is not ready to do something
like that (there are too much child_spacing/borders values that are set
outside onInitTheme).

A better way is to ask to the theme itself (Theme::getWidgetFont())
about what font to use for each specific widget. And the Widget::m_font
field can act as a cache of this requested font. So now the "mini font"
is specified in a SkinProperty's flag.
2015-05-05 19:14:33 -03:00
David Capello
dbad153698 Add she::Font class (wrapper of Allegro FONT)
This is an huge refactor to avoid handling Allegro FONT directly. Some
changes:
* Add she::System::defaultDisplay/Font, createRgbaSurface, loadSurface,
  and loadRgbaSurface.
* Rename she::CreateSystem/Instance to she::create_system/instance.
* Remove ui/font.cpp and move ui/fontbmp.cpp to she library.
* ui::IButtonIcon uses she::Surface instead of BITMAP.
* Rename she::LockedSurface::drawAlphaSurface -> drawRgbaSurface
* Rename ui::SetDisplay -> set_display
* Rename _ji_font_text_len -> ui::Graphics::measureUIStringLength
2014-06-22 18:53:14 -03:00
David Capello
78ce233756 Fix header of files distributed under the terms of the MIT license 2014-03-29 20:08:05 -03:00
David Capello
cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00
David Capello
c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem
2013-08-05 21:20:19 -03:00
David Capello
6e62bcb82f Add ui::WidgetType enum to replace JI_WIDGET macros 2013-04-03 22:07:24 -03:00
David Capello
cb0cdb3197 Rename old _ji_* functions 2013-03-30 13:38:24 -03:00
David Capello
9b8e87da10 Update copyright year to 2013 2013-01-27 12:13:13 -03:00
David Capello
c5cf588370 Rename some member_functions to memberFunctions 2013-01-11 12:43:25 -03:00
David Capello
0496f38ed3 Fix a typo in all files distributed under BSD-like and Allegro licenses
Thanks to Tobias Hansen.
2012-09-23 23:24:43 -03:00
David Capello
91bf74350e Rename ui::Frame to ui::Window. 2012-07-08 23:24:42 -03:00
David Capello
55aca8567c Move src/gui/ to src/ui/ 2012-06-17 22:49:58 -03:00