Commit Graph

108 Commits

Author SHA1 Message Date
David Capello c0614f2ff0 Tabs: fix minor issues pressing two buttons or dragging with middle button 2015-04-02 17:13:11 -03:00
David Capello 5afee63f6b Avoid calling Tabs::startAnimation() each time Tabs::setDropViewPreview() is called 2015-04-02 16:38:51 -03:00
David Capello 13c06d8541 Fix reordering of tabs in docked WorkspaceTabs 2015-04-02 16:01:45 -03:00
David Capello e24c03f929 Add possibility to move tabs between different WorkspaceTabs widgets 2015-04-02 15:43:50 -03:00
David Capello c7379f6ecf Fix problem redrawing the main Tabs when the last tab is closed
For this, on AnimatedWidget, before we call onAnimationStop(), we
set m_animation to 0 to know that there is no animation in progress.
Tabs depends on m_animation to know if it needs extra space when there
are no more tabs (the extra space is used to show the animation that to
collapse Tabs).
2015-04-02 09:43:52 -03:00
David Capello 6e8705eeb3 Remove unused variables in tabs.cpp 2015-04-01 12:35:28 -03:00
David Capello 27c7f31175 Replace std::shared_ptr/unique_ptr with SharedPtr/UniquePtr 2015-04-01 11:37:01 -03:00
David Capello 9dd944fc76 Add "docked" style for WorkspaceTabs 2015-04-01 10:27:22 -03:00
David Capello 86afa3a568 Add support to dock tabs as other Workspace panels 2015-03-31 17:31:45 -03:00
David Capello 11abb11f9b Add animation to Workspace preview drop area 2015-03-27 19:42:18 -03:00
David Capello 47948ee888 Move app::Tabs animation related stuff to app::AnimatedWidget 2015-03-27 18:35:42 -03:00
David Capello 2cfef9e250 Add feedback to Workspace to drop tabs on it 2015-03-27 18:14:00 -03:00
David Capello 3b8cc3b8ea Merge remote-tracking branch 'origin/master' 2015-03-26 07:31:10 -03:00
David Capello 3e44399e4b Remove unused local variables 2015-03-25 16:38:56 -03:00
David Capello 7eefe4e3c6 Minor adjustment for alpha=0 in floating tab borders 2015-03-24 15:19:42 -03:00
David Capello e506387dad Add floating tabs in Tabs widget 2015-03-24 11:52:19 -03:00
David Capello f71a377a4f Fix problem with the first drag-and-drop on Tabs widget 2015-03-23 16:37:50 -03:00
David Capello f9a444aed7 Show "Home" tab in first position when we open a file from command line 2015-03-18 17:34:22 -03:00
David Capello 79c30a9ef3 Fix crash if we close a tab when we're dragging it 2015-03-17 16:56:55 -03:00
David Capello b23194dfae Fix several warnings in MSVC, clang, and gcc 2015-03-05 15:19:00 -03:00
David Capello 200e612670 Simplify Workspace implementation removing the possibility to split views/tabs
It's confusing to see two tabs when we split the view. In the future we
should be able to move tabs to create a split view.
2015-03-04 17:23:40 -03:00
David Capello 4690844d60 Fix crash closing the program when there is no tab (introduced in 1087cb84cf) 2015-03-03 09:26:24 -03:00
David Capello a2e0be19d8 Tabs: Fix drawing of m_removedTab 2015-03-03 09:25:18 -03:00
David Capello 122bf1dd1c Clip tab icon on Tabs::drawTab() 2015-03-03 09:11:37 -03:00
David Capello 1087cb84cf Don't shrink Tabs area until the last tab animation ends 2015-03-03 09:07:49 -03:00
David Capello c396f271c8 Fix problem changing tabs with the mouse wheel 2015-02-25 09:00:19 -03:00
David Capello 7839a6761a Minor fix in Tabs::calculateHot() detecting the area to close a tab 2015-02-24 20:21:29 -03:00
David Capello 8c6f55cc41 Add support to reorder tabs (close #118) 2015-02-24 20:10:22 -03:00
David Capello 2d64c55661 Minor fixes in click on tabs behavior 2015-02-23 10:52:04 -03:00
David Capello ff66ea025c Add support to close Home tab with middle mouse button or right-click popup menu 2015-02-22 21:18:53 -03:00
David Capello 926e714f74 Don't show close buttons for small tabs
Only the selected tab has a visible close button regardless of its size.
2015-02-22 13:06:22 -03:00
David Capello 8fa97cba32 Animate all tabs when a tab is added or removed
As now there is no scroll in Tabs widget, and the width of all tabs might
vary when a new one is added/removed (e.g. when there is not enough space),
we've to animated them all.

Removed ANI_SMOOTH_SCROLL_TICKS animation, now all animations are
controlled in the same way using a Tabs::Tab::oldX/oldWidth/x/width fields.
2015-02-21 20:06:35 -03:00
David Capello b52bcd8c95 Fix close icon style after clicking tabs 2015-02-20 08:53:52 -03:00
David Capello e850c8dbb0 Add an icon to "Home" tab 2015-02-19 21:44:22 -03:00
David Capello f4e01345c6 Add close/modified icon to tabs 2015-02-19 13:13:25 -03:00
David Capello de3e46d879 Draw Tabs widget using styles.
* Add background-repeat style rule to specify how to repeat the
  background image
* Remove PART_TAB_* skin parts from skin_parts.h
2015-02-17 16:03:00 -03:00
David Capello 11386543c8 Add <dimensions> to skin.xml 2015-02-17 12:22:46 -03:00
David Capello 881667f01b Replaced app::skin::ThemeColor with app::gen::SkinTheme::Colors
Generate app::gen::SkinFile class from skin.xml to automate creation
of ID references.
2015-02-15 15:29:16 -03:00
David Capello c473c99525 Simplify Tabs::m_list iterations 2015-02-15 11:45:23 -03:00
David Capello f3974002d5 Fix int <-> double <-> float casts
It looks like allegro includes several implicit conversions between
float and double.
2015-02-14 22:37:56 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello ca9df1a05e Rename ui::jguiscale() to ui::guiscale()
* Change Theme::guiscale member to Theme::m_guiscale
2014-11-25 22:33:45 -03:00
David Capello 752faf11f2 Remove jmouse_[xyz]() functions 2014-11-25 22:10:28 -03:00
David Capello 6824570c4b Remove base/override.h (use override keyword directly) 2014-08-14 23:07:47 -03:00
David Capello b1b4ed8b39 Don't block Menu::showPopup() with a customized event loop
We must call Menu::showPopup() in ui::kMouseUpMessage message.
2014-08-09 11:13:51 -03:00
David Capello 4b7bf5b835 Merge she::Color and ui::Color types in gfx::Color 2014-06-28 16:10:39 -03:00
David Capello 5bbff161b9 Now ui::Graphics uses she::Surface instead of Allegro BITMAP 2014-06-26 22:14:39 -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 ec61c6b972 Add support for horizontal mouse wheel and scroll bar notifications (better support for trackpads)
WM_HSCROLL/WM_VSCROLL messages are used by some trackpads drivers to
notify about horizontal/vertical pan gestures.
2014-04-28 22:02:56 -03:00
David Capello dd2ce20e25 Win32: Add support to convert mouse messages (WM_) to ui::Messages (using she::Events)
On Windows, instead of polling Allegro mouse position/buttons we can use
the mouse messages (WM_*) directly to generate she::Events. Those events
are received by the ui::Manager and converted to ui::Messages.
Maybe this is a possible fix for issue #133 (Wacom tablets don't work
properly).

Changes:
- Don't use jmouse_z() directly (new ui::MouseMessage::wheelDelta() member)
- Add ui::_internal_set_mouse_position() to change the jmouse_x/y(0)
  from the new mouse position received in she::Events. The same for
  ui::_internal_set_mouse_buttons().
- Modify the ui::Manager to generate mouse events in any case: using old
  Allegro 4 polling method, or from she::Events.
2014-04-17 22:23:12 -03:00
David Capello 6ca003feb0 Do not show empty tabs area in Tabs widget 2014-04-17 14:47:28 -03:00
David Capello ab53c81a75 Minor fix in Tabs when close button in each tab is enabled
Anyway the close button doesn't work at this moment.
2014-04-17 14:39:29 -03:00
David Capello 04f3c522ba Replace jwidget_get_text_length/height with Widget::getTextWidth/Height
Renamed Widget::getTextSize to Widget::getTextLength as now getTextSize
returns a gfx::Size() (not the strlen() of the text)
2014-03-21 19:45:35 -03:00
David Capello 04a0845a62 SkinTheme: paint windows using styles 2014-03-21 00:28:01 -03:00
David Capello dd2839a49a Add app::StartView (work-in-progress) 2014-02-02 20:55:32 -03:00
David Capello dbf4d0d490 Replace JRect/jrect struct with gfx::Rect
- Replaced Widget::rc -> Widget::m_bounds private member.
- Added Widget::offsetWidgets() method.
- Removed View::displaceWidgets().
2013-10-26 12:50:55 -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