Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 26c8a63

Browse files
Merge pull request #1949 from livecode/bugfix-21116
[[ Bug 21116 ]] Ensure table style DG has mobile scrollers
2 parents f8005f2 + 2ac75ac commit 26c8a63

File tree

2 files changed

+64
-37
lines changed

2 files changed

+64
-37
lines changed

Toolset/palettes/revdatagridlibrary/behaviorsdatagridbuttonbehavior.livecodescript

Lines changed: 63 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3560,52 +3560,78 @@ end _table.ScrollColumnIntoView
35603560

35613561

35623562
private command _table.LayoutDataArea
3563-
local theViewRect, theRect, theRootGroup
3563+
local theViewRect, theRect
35643564
put _WorkingGroupRect(the long ID of me) into theViewRect
35653565
put theViewRect into theRect
3566-
put the long ID of group "dgHeaderComponents" of me into theRootGroup
35673566

3568-
## Shift all content
3569-
set the topLeft of theRootGroup to item 1 to 2 of theRect
3570-
3571-
## Reposition bottom element
3572-
local theSBWidth
3573-
if the visible of scrollbar "dgScrollbar" of me then put the width of scrollbar "dgScrollbar" of me into theSBWidth
3574-
else put the dgProps["scrollbar corner offset"] of me into theSBWidth
3575-
set the visible of graphic "dgCornerPiece" of group "dgHorizontalComponents" of me to the visible of scrollbar "dgScrollbar" of me
3576-
3577-
set the rect of scrollbar "dgHScrollbar" of group "dgHorizontalComponents" of me to \
3578-
item 1 of theRect, item 4 of theRect - the height of scrollbar "dgHScrollbar" of group "dgHorizontalComponents" of me, \
3579-
item 3 of theRect - theSBWidth, item 4 of theRect
3567+
local tHeaderComponents, tHorizontalComponents
3568+
local tVScrollbar, tHScrollbar, tCornerPiece
3569+
put the long id of group "dgHeaderComponents" of me into tHeaderComponents
3570+
put the long id of group "dgHorizontalComponents" of me into tHorizontalComponents
3571+
put the long id of scrollbar "dgScrollbar" of me into tVScrollbar
3572+
put the long id of scrollbar "dgHScrollbar" of tHorizontalComponents into tHScrollbar
3573+
put the long id of graphic "dgCornerPiece" of tHorizontalComponents into tCornerPiece
35803574

3581-
## Header mask
3582-
put the bottom of group "dgHeaderMask" of theRootGroup into item 4 of theRect
3583-
set the rect of group "dgHeaderMask" of theRootGroup to theRect
3575+
## Shift all content
3576+
set the topLeft of tHeaderComponents to item 1 to 2 of theRect
35843577

3585-
## Define new top/bottom
3586-
if the visible of theRootGroup then
3587-
put item 4 of theRect into item 2 of theRect
3578+
if the visible of tHeaderComponents then
3579+
# Set the rect of the header mask
3580+
local tHeaderMaskRect
3581+
put theRect into tHeaderMaskRect
3582+
put the bottom of group "dgHeaderMask" of tHeaderComponents into item 4 of tHeaderMaskRect
3583+
set the rect of group "dgHeaderMask" of tHeaderComponents to tHeaderMaskRect
3584+
## Define new top of content rect
3585+
put item 4 of tHeaderMaskRect into item 2 of theRect
35883586
end if
35893587

3590-
if the visible of group "dgHorizontalComponents" of me then
3591-
put the top of scrollbar "dgHScrollbar" of group "dgHorizontalComponents" of me into item 4 of theRect
3592-
else
3593-
put item 4 of theViewRect - the dgProps["scrollbar corner offset"] of me into item 4 of theRect
3588+
if the environment is not "mobile" then
3589+
## Reposition bottom element
3590+
local theSBWidth
3591+
if the visible of tVScrollbar then
3592+
put the width of tVScrollbar into theSBWidth
3593+
else
3594+
put the dgProps["scrollbar corner offset"] of me into theSBWidth
3595+
end if
3596+
# If the hscrollbar is not shown, then the horizontal components group
3597+
# containing it is invisible, so the corner piece is also invisible.
3598+
# So we can just set visibility of corner piece to the visible of the
3599+
# vscrollbar
3600+
set the visible of tCornerPiece to the visible of tVScrollbar
3601+
3602+
set the rect of tHScrollbar to \
3603+
item 1 of theRect, \
3604+
item 4 of theRect - the height of tHScrollbar, \
3605+
item 3 of theRect - theSBWidth, item 4 of theRect
3606+
3607+
if the visible of tHorizontalComponents then
3608+
put the top of tHScrollbar into item 4 of theRect
3609+
else
3610+
put item 4 of theViewRect - the dgProps["scrollbar corner offset"] of me \
3611+
into item 4 of theRect
3612+
end if
3613+
3614+
## V Scrollbar and corner piece
3615+
set the rect of tVScrollbar to \
3616+
item 3 of theRect - the width of tVScrollbar, \
3617+
item 2 of theRect, item 3 of theRect, \
3618+
item 4 of theRect
3619+
3620+
set the rect of tCornerPiece to \
3621+
item 3 of theRect - the width of tVScrollbar, \
3622+
the top of tHScrollbar, \
3623+
item 3 of theRect, \
3624+
the bottom of tHScrollbar
3625+
3626+
## Masks
3627+
## AL-2013-07-30 [[ Bug 10108 ]] Thumb and scrollbar appear over top of DataGrid
3628+
if the visible of tVScrollbar then
3629+
put item 3 of theRect - theSBWidth into item 3 of theRect
3630+
end if
3631+
else if __HasMobileScroller() then
3632+
mobileControlSet sScrollerId, "rect", theRect
35943633
end if
35953634

3596-
## V Scrollbar and corner piece
3597-
set the rect of scrollbar "dgScrollbar" of me to item 3 of theRect - the width of scrollbar "dgScrollbar" of me, \
3598-
item 2 of theRect, item 3 of theRect, \
3599-
item 4 of theRect
3600-
3601-
set the rect of graphic "dgCornerPiece" of group "dgHorizontalComponents" of me to \
3602-
item 3 of theRect - the width of scrollbar "dgScrollbar" of me, \
3603-
the top of scrollbar "dgHScrollbar" of group "dgHorizontalComponents" of me, item 3 of theRect, \
3604-
the bottom of scrollbar "dgHScrollbar" of group "dgHorizontalComponents" of me
3605-
3606-
## Masks
3607-
## AL-2013-07-30 [[ Bug 10108 ]] Thumb and scrollbar appear over top of DataGrid
3608-
if the visible of scrollbar "dgScrollbar" of me then put item 3 of theRect - theSBWidth into item 3 of theRect
36093635
set the topLeft of group "dgListMask" of me to item 1 to 2 of theRect
36103636
set the rect of group "dgListMask" of me to theRect
36113637
set the rect of group "dgAlternatingRowsMask" of me to theRect

notes/bugfix-21116.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Table style DataGrid should also have mobile scrollers

0 commit comments

Comments
 (0)