summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-08-26LibGUI+HackStudio: Associate new icons with their extensionsthankyouverycool
2020-08-26Base: Add new icons for HackStudiothankyouverycool
Adds new filetype icons for forms and project files and a new root icon for HackStudio's project tree.
2020-08-26WindowServer+LibGfx: Move title bar button layout to WindowThemethankyouverycool
2020-08-26AK+LibC+LibCore: Have fewer implementations of day_of_weekNico Weber
The implementation in LibC did a timestamp->day-of-week conversion which looks like a valuable thing to have. But we only need it in time_to_tm, where we already computed year/month/day -- so let's consolidate on the day_of_week function in DateTime (which is getting extracted to AK).
2020-08-26LibC: Minor style tweaks to tm_to_timeNico Weber
2020-08-26AK+LibC+LibCore: Add a days_in_year functionNico Weber
2020-08-26AK+LibC+LibCore: Have fewer implementations of days_in_monthNico Weber
2020-08-26LibCore: Use is_leap_year more in DateTimeNico Weber
2020-08-26Kernel: Minor tweak to now() computationNico Weber
Make sure the expression is evaluated as time_t so that it does the right thing after 2037, and factor things so that the constants look less magical.
2020-08-26AK+LibCore+Kernel: Have fewer implementations of day_of_yearNico Weber
The JS tests pointed out that the implementation in DateTime had an off-by-one in the month when doing the leap year check, so this change fixes that bug.
2020-08-26LibJS: Add some more tests, mostly around leap yearsNico Weber
2020-08-26AK+LibC+Kernel: Have fewer implementations of year_to_days_in_epochNico Weber
I believe the implementation in RTC.cpp had an off-by-one in the year passed to is_leap_year(). If that's true, then this fixes that too.
2020-08-26AK+LibC+LibCore+Kernel: Have fewer implementations of is_leap_yearNico Weber
2020-08-26LibJS: Add a helper for calling JS::Function's with argumentsAnotherTest
The fact that a `MarkedValueList` had to be created was just annoying, so here's an alternative. This patchset also removes some (now) unneeded MarkedValueList.h includes.
2020-08-26LibWeb: Calculate selection based on glyph centersRewi Haar
Previously you had to drag all the way to the end of a glyph to select it; now you just need to drag past the center. Also fixes #2959.
2020-08-26Kernel: Fix losing PTEsTom
We can't use a HashMap with a small key that doesn't guarantee collisions. Change it to a HashTable instead. Fixes #3254
2020-08-26Kernel: Protect looping over VMObject regionsTom
We need to hold the memory manager lock so nobody else can modify these lists while we're iterating them.
2020-08-26AK: Demonstrate and fix CheckedBen Wiederhake
Specifically: - post-increment actually implemented pre-increment - helper-templates that provided operator{+,-,*,/}() couldn't possibly work, because the interface of add (etc) were incompatible (not taking a Checked<>, and returning void)
2020-08-26LibC: Deduplicate declaration of strcasecmpBen Wiederhake
2020-08-26LibGUI: HeaderView should always notify parent when sections resizeAndreas Kling
The view needs to recompute the scrollable content size whenever this happens, so let's always notify it. Previously we were only doing this when resizing columns with interactively (not programmatically.)
2020-08-26LibGUI: Rename table view's "cell painting delegate" to "column *"Andreas Kling
What you install with this API is a delegate that manages painting of all the items in a specific column, so let's make the API reflect that.
2020-08-26LibGUI: Move table view headers into their own widgetAndreas Kling
This patch introduces the HeaderView class, which is a widget that implements the column headers of TableView and TreeView. This greatly simplifies event management in the view implementations and also makes it much easier to eventually implement row headers.
2020-08-26LibGUI: Make Splitter inherit from Widget instead of FrameAndreas Kling
It wasn't using any of the Frame features, so I'm not sure what the idea here was.
2020-08-26LibGUI: Clip GUI::Frame children to the frame_inner_rect()Andreas Kling
This way we don't draw the frame border underneath our children. :^)
2020-08-26LibGUI: Allow widgets to clip their child widgetsAndreas Kling
This patch adds Widget::children_clip_rect() which can be overridden to tighten clipping of a widget's children. The default implementation simply returns Widget::rect().
2020-08-26Spreadsheet: Focus the spreadsheet table on startupAndreas Kling
2020-08-26LibGUI: Add Widget focus proxiesAndreas Kling
A Widget can now have a focus proxy widget. Questions about focus are redirected to the proxy if present. This is useful if a widget could logically get focus, but wants one of its child widgets to actually handle it.
2020-08-26LibC: Prospective fix for openssl buildSergio Ahumada
serenity/Build/Root/usr/include/sys/socket.h:93:26: error: 'sockaddr_un' undeclared here (not in a function) 93 | char data[sizeof(sockaddr_un)]; | ^~~~~~~~~~~ make[2]: *** [<builtin>: bss_fd.o] Error 1
2020-08-26LibGUI: Change window size and margin in ColorPickerLepkoQQ
2020-08-26LibGUI: Add spinbox for alpha channel in ColorPickerLepkoQQ
2020-08-26LibGUI: Show current and selected color comparison in ColorPickerLepkoQQ
2020-08-26LibGUI: Resize ColorPicker to include frame thicknessLepkoQQ
Also clamp mouse events to frame rect when dragging outside of the color field area. Store hue separately from color, to prevent pure white resetting the hue back to 0.
2020-08-26LibGUI: Split ColorPicker in to a field and sliderLepkoQQ
2020-08-26LibGfx: Use valid hsv values in painter debugLepkoQQ
2020-08-26LibGfx: Always use 0..360 0..1 0..1 in HSV colorsLepkoQQ
2020-08-26LibGUI: Select current color when opening pickerLepkoQQ
2020-08-25JS Tests: Disable the one failing test when running test-js in SerenityNico Weber
2020-08-25LibGUI: Make ScrollBar show hover state of scrubber after gutter dragNico Weber
With this, if clicking the gutter until the scrubber's below the mouse and then releasing the mouse, the scrubber is correctly highlighted after releasing the mouse.
2020-08-25LibGUI: Only paint ScrollBar hover states if a component is pressedNico Weber
While left-mouse is pressed on any component (arrows, gutter, scrubber), don't draw hover states for components other than the pressed component. For example, while clicking the arrow-down button and then dragging around, the arrow-up button and the scrubber now aren't highlighted. This also means that during a gutter drag session, the scrubber isn't highlighted while it's under the mouse cursor. That makes sense, since we get the gutter drag behavior, not the scrubber drag behavior, in this case. The highlight is supposed to indicate "clickability", but if the mouse is already down, they can't be clicked. Now that I check for it, this seems to match the scrollbar behavior on Windows.
2020-08-25LibGUI: Make ScrollBar track the currently pressed componentNico Weber
And remove the now-redundant members m_scrubbing, m_scrubber_in_use, and m_automatic_scrolling_kind. This also made it clear that we weren't canceling the autoscroll timer if the scrollbar got disabled while it was scrolling, so this fixes that too.
2020-08-25LibJS: Make Interpreter::throw_exception() a void functionLinus Groh
The motivation for this change is twofold: - Returning a JS::Value is misleading as one would expect it to carry some meaningful information, like maybe the error object that's being created, but in fact it is always empty. Supposedly to serve as a shortcut for the common case of "throw and return empty value", but that's just leading us to my second point. - Inconsistent usage / coding style: as of this commit there are 114 uses of throw_exception() discarding its return value and 55 uses directly returning the call result (in LibJS, not counting LibWeb); with the first style often having a more explicit empty value (or nullptr in some cases) return anyway. One more line to always make the return value obvious is should be worth it. So now it's basically always these steps, which is already being used in the majority of cases (as outlined above): - Throw an exception. This mutates interpreter state by updating m_exception and unwinding, but doesn't return anything. - Let the caller explicitly return an empty value, nullptr or anything else itself.
2020-08-25LibGUI: Make scrollbars keep scrolling by page while clicking the gutterNico Weber
Note that m_hovered_component is only updated on mouse move, not while just keeping left down. It's arguably wrong to update it on mouse move while the mouse is down, I'll probably change things so that it doesn't update there either. The behavior on click-in-gutter-keep-left-down-then-move-mouse varies a surprising amount between platforms. This implements the macOS behavior where the scrubber follows the mouse direction while scrolling by pages. (To be precise, it's the macOS behavior of Finder and Preview, Safari has Windows's scrollbar behavior). On Windows, the first click locks in the scroll direction and then dragging the mouse off the scrubber in that direction makes the scroll continue, but dragging it off the other direction has no effect. I see no reason for that behavior.
2020-08-25LibGUI: Keep scrollbar timer active while mouse is downNico Weber
Rather than disable and re-enable the timer, always keep it active and make it do collision checks to decide if it should have an effect. This is because set_automatic_scrolling_active(true) calls the timeout callback immediately before starting the timer, and when clicking the gutter this callback could disable the timer again (if the first page scroll put the scrubber under the cursor). Intead of making set_automatic_scrolling_active() work when it's called reentrantly (which is easy: just swap the order of on_automatic_scrolling_timer_fired() and timer->start() so that on_automatic_scrolling_timer_fired() can immediately stop the timer again, but it's confusing), make the timer check if it should do anything. This is keyed off m_last_mouse_position instead of m_hovered_component because m_hovered_component is a visual state and we arguably shouldn't modify it while the left mouse button is down (as it indicated what part is activated on click).
2020-08-25LibGUI: Extract ScrollBar::update_hovered_component() methodNico Weber
2020-08-25LibGUI: Extract ScrollBar::component_at_position() methodNico Weber
...and use it in mousedown_event(), which allows putting in stricter asserts.
2020-08-25AK: Add Endian.h header to replace NetworkOrdered.h.asynts
2020-08-25LibGUI: Make AutomaticScrollingKind a paramter on set_automatic_scrolling_activeNico Weber
Most callers of set_automatic_scrolling_active() also change m_automatic_scrolling_kind, and it makes it possible to make timer behavior dependent on the autoscroll kind later.
2020-08-25LibGUI: In ScrollBar, rename AutomaticScrollingDirection to ↵Nico Weber
AutomaticScrollingKind Also rename Decrement to DecrementButton and Increment to IncrementButton.
2020-08-25LibGUI: Make ScrollBar shift-click use same code path as scrubber clickNico Weber
It's slightly less code, and m_scrubber_in_use is now set correctly when shift-clicking, keeping the mouse button down, and then dragging the throbber. The shift-click brings the scrubber under the cursor, and then the scrubber_rect().contains() condition is true and both scrubber drags and shift-click-drags are handled the same naturally.
2020-08-25AK: TestSuite: Define assert macros with do { } while(0). (#3292)Paul Scharnofske
Consider the following scenario: if(condition) FOO(); else bar(); Suppose FOO is defined as follows: #define FOO() { bar(); baz(); } Then it expands to the following: if(condition) // Syntax error, we are not allowed to put a semicolon at the end. { bar(); baz(); }; else bar(); If we define FOO as follows: #define FOO() do { bar(); baz(); } while(false) Then it expands to the following: if(condition) do { bar(); baz(); } while(false); else bar(); Which is correct.