1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-23 10:42:11 +02:00
Commit Graph

189 Commits

Author SHA1 Message Date
David Rosca
e9f3679bb1
TabTreeModel: Sync top-level tabs with main tabbar
This way the order of top-level tabs is also preserved in session.
2018-02-04 17:18:23 +01:00
David Rosca
9f4ac24cf8
TabBar: Initialize pinned tab width from real tab
Calculates the padding between tab border and icon from tabRect
instead of using style pixel metric which was oftentimes incorrect.

Pinned tabs should now have correct size and icon be perfectly centered
with all possible widget and qss styles.
2018-02-04 16:58:35 +01:00
David Rosca
0c7245fa9f
TabContextMenu: Require only WebTab in constructor 2018-02-04 16:58:08 +01:00
David Rosca
349f6b9c32
TabWidget: Fix emitting tabMoved when pinning tabs 2018-02-04 16:57:49 +01:00
David Rosca
188082b690
TabModel: Add AudioPlayingRole and AudioMutedRole 2018-02-04 16:56:04 +01:00
David Rosca
47be65f903
TabIcon: Make static image data public 2018-02-04 16:47:25 +01:00
David Rosca
59dbfc1f48
TabTreeModel: Reset model when source resets 2018-01-31 21:06:33 +01:00
David Rosca
ebaab19f88
TabWidget: Correctly emit tabRemoved when detaching tab 2018-01-31 21:05:56 +01:00
David Rosca
43e472e50e
TabBar: Disallow detaching tab when there is only one tab in the only window
Otherwise it would close the last window which would quit the app.
2018-01-31 21:05:48 +01:00
David Rosca
dc8ddb03c1
TabTreeModel: Don't allow to move pinned tabs 2018-01-31 21:05:41 +01:00
David Rosca
85def54d3c
WebTab: Preserve order of child tabs in session file 2018-01-31 21:05:30 +01:00
David Rosca
e57fb65c95
Add TabTreeModel
This model orders tabs in "Tree Style Tabs" fashion.
2018-01-31 21:03:06 +01:00
David Rosca
57b605e4e0
TabModel: add CurrentTabRole and LoadingRole 2018-01-31 21:01:36 +01:00
David Rosca
a8bda61f3e
TabModel: Remove ParentTabRole and ChildTabsRole 2018-01-31 21:00:20 +01:00
David Rosca
1b473ac580
Detach WebTab when removing tab
That way tab is removed from parent and children before
it is removed from tabbar.
2018-01-31 20:56:48 +01:00
David Rosca
72c4b605a5
TabModel: Implement drag&drop 2018-01-31 20:56:39 +01:00
David Rosca
61299c89b6
WebTab: Save parent tab index in session file 2018-01-31 20:55:35 +01:00
David Rosca
e44877d4c7
WebTab: Add parentTab and childTabs properties 2018-01-31 20:54:59 +01:00
David Rosca
2377503517
Add TabModel 2018-01-31 20:54:50 +01:00
David Rosca
1fe7f0c232
Correctly handle possibility that page changes in WebView 2018-01-28 22:41:08 +01:00
David Rosca
b5d872f64e
TabContextMenu: Add Load Tab action 2018-01-28 22:40:46 +01:00
David Rosca
ba75905134 TabContextMenu: Add Unload Tab action
Closes #2563
2018-01-24 15:15:03 +01:00
David Rosca
0b1d9e0b16 TabIcon: Don't resize to (0,0) when hiding
ComboTabBar depends on tab button position for calculating
drag offset and it breaks with some themes that returns invalid
subElementRect for buttons with (0,0) size.
2018-01-13 16:42:54 +01:00
David Rosca
cf5831d1db ComboTabBar: Ignore buttons that returns invalid element rect in dragOffset
Closes #2546
2018-01-13 16:42:35 +01:00
David Rosca
b21e2634bc ComboTabBar: Only reset dragInProgress on left mouse button release 2018-01-13 16:42:30 +01:00
David Rosca
54bad20590 ComboTabBar: Fix division by zero when icon pixmap is null 2018-01-13 16:42:24 +01:00
David Rosca
195d3f2b93 TabWidget: Reset zoom when resetting tab when closing last tab
Closes #2540
2018-01-11 19:56:19 +01:00
David Rosca
5cd580d284 ComboTabBar: Update moving tab contents during drag
Unlike QTabBar, ComboTabBar now redraws contents of moving tab.
2018-01-11 19:50:31 +01:00
David Rosca
d7146519b4 ComboTabBar: Fix draggedTabRect returning rect of current instead of pressed index 2018-01-11 19:50:26 +01:00
David Rosca
b2de2a00f4 ComboTabBar: Fix tabPixmap with high-dpi 2018-01-11 19:50:23 +01:00
David Rosca
516bd92089 TabBar: Allow to change width of tabs using style sheets
It can be set in themes or in userChrome.css as in example.

/* userChrome.css */
TabBarTabMetrics
{
    qproperty-normalMaxWidth: 250;
    qproperty-normalMinWidth: 150;
    qproperty-activeMinWidth: 150;
    qproperty-overflowedWidth: 150;
    qproperty-pinnedWidth: 35;
}
2018-01-11 19:49:12 +01:00
David Rosca
95921692be ComboTabBar: Apply padding adjustment to all tabs 2018-01-11 19:49:03 +01:00
David Rosca
21bd073482 TabBar: Increase drag start distance to not disturb tab moving
Also remove no longer needed timer to show add tab button.
2018-01-11 19:48:55 +01:00
David Rosca
50d1bb6d96 ComboTabBar: Add possibility to change base color from stylesheets 2018-01-11 19:46:33 +01:00
David Rosca
49ebfa3f5d TabBar: Don't hide add tab button when moving tabs 2018-01-11 19:46:06 +01:00
David Rosca
68ed91c909 ComboTabBar: Block moving tabs outside of tabbar 2018-01-11 19:46:03 +01:00
David Rosca
26a2b55c24 ComboTabBar: Don't call QTabBar paintEvent implementation during drag
Implement udpating geometry of moving tab.
2018-01-11 19:45:58 +01:00
David Rosca
8ea8b56f27 ComboTabBar: Add draggedTabRect method 2018-01-11 19:45:46 +01:00
David Rosca
84c4f0ff4d TabBar: Don't show context menu when dragging tab
Otherwise it breaks tabbar state.
2018-01-11 19:45:41 +01:00
David Rosca
78383c007e TabBar: Always send mouse events to ComboTabBar
It needs every event to correctly update dragInProgress property.
2018-01-11 19:45:36 +01:00
David Rosca
4e988ac8f2 ComboTabBar: Fixes in drawing tabs with drag offset
m_dragInProgress is now only true when dragging tab, not during
the tab sliding to target position animation.
2018-01-11 19:45:32 +01:00
David Rosca
6a48f4d862 TabBar: Disable greying out not restored tabs
It doesn't really work with some themes and there doesn't seem
to be easy way to make the text always clearly visible.
2018-01-11 19:45:27 +01:00
David Rosca
4c7eaf0f9f ComboTabBar: Add support for tabPadding property
Workarounds bug where tabs have zero padding when styled using style
sheets.
2018-01-11 19:44:50 +01:00
David Rosca
e617f3f6ec ComboTabBar: Fix drop indicator position on last tab 2018-01-11 19:44:45 +01:00
David Rosca
679a5f0136 ComboTabBar: Also use our TabBarHelper drawing code when drag is in progress 2018-01-11 19:44:40 +01:00
David Rosca
47ee7bfbca TabWidget: Set outside-tabbar property to both add tab buttons
It is now possible to exclusively distinguish both buttons.
2018-01-11 19:43:38 +01:00
David Rosca
7e8b2a103b ComboTabBar: Draw tab as only one in tabbar in tabPixmap 2018-01-11 19:43:33 +01:00
David Rosca
848a61440c TabWidget: Hide closed tabs button when there are no closed tabs 2018-01-11 19:42:46 +01:00
David Rosca
4c494ebfb0 ComboTabBar: Improve drop indicator drawing
Code was taken and modified from KFilePlacesView
2018-01-11 19:31:41 +01:00
David Rosca
65d1493f0a Fix closing tabs - regression from last commits
Closes #2534
2018-01-11 19:25:48 +01:00