Skip to content

[ConfirmBox] remove margin around #12039

Merged
2 commits merged into
masterfrom
unknown repository
Jun 18, 2024
Merged

[ConfirmBox] remove margin around #12039
2 commits merged into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Jun 16, 2024

Copy link
Copy Markdown

The current version looks like
grafik

But it should look this way
grafik


This change is Reviewable

@mergen3107

Copy link
Copy Markdown
Contributor

I had this in the back of my mind, but didn't think it's worth time and effort to ask :D Thanks!

@poire-z

poire-z commented Jun 16, 2024

Copy link
Copy Markdown
Contributor

I think this was made on purpose, ie. so we can see the border when it is displayed over some black content (ie. some PDF with black background or images).
Like it is done with subtitles in movies (explained in first item in #11846 (comment))

I think we have this behaviour in many places.
But may be not:
image

image

image

image

image

image

No strong opinion which is best.

@benoit-pierre

Copy link
Copy Markdown
Member

It looks much better without it (on both dark and light backgrounds).

@Frenzie

Frenzie commented Jun 16, 2024

Copy link
Copy Markdown
Member

I think the white border looks better on a device than on this screenshot but yeah I'd do without.


local frame = FrameContainer:new{
background = Blitbuffer.COLOR_WHITE,
margin = self.margin,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elsewhere where self.margin is used isn't messed up by this singular removal?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have found two more (multiconfirmbox, readerstyletweak). I hope these are all.

The toast messages (Notifications) do have that margin, but these are different anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather I meant within this very file, but in that case the same question applies to those other files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be, it is added to the width of a VerticalSpan.
Or may be not: there, it is used as some vertical "width", for separation between the text and the bottom buttontable. Size.margin.default + Size.padding.default. A bit ugly.
I think it's best to either set margin = 0 instead of Size.margin.default in InputContainer:extend{} (this would allow other widget to set it), or remove every occurence of margin / self.margin.
(InfoMessage does not have any such margin)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I meant a white margin around the toast, not the particular margin = ... ;) )

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConfirmBox:
In my reading, the VerticalSpan in line 165 uses the outer self.margin (which is 5) and it is independent of the FrameContainer margin.

MovableContainer:new{
FrameContainer:new{
background = Blitbuffer.COLOR_WHITE,
margin = self.margin,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the same as in ConfirmBox

FrameContainer:new{
background = Blitbuffer.COLOR_WHITE,
radius = Size.radius.window,
margin = Size.margin.default,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be no problem at all.

@Frenzie Frenzie added this to the 2024.06 milestone Jun 17, 2024
@ghost ghost merged commit 8b88f5e into koreader:master Jun 18, 2024
@ghost ghost deleted the FixConfirmBoxMargin branch June 18, 2024 05:15
@Commodore64user

Commodore64user commented Jun 21, 2024

Copy link
Copy Markdown
Member

There is more of this nonsense in the Ignore all horizontal margins widget box (when you long press on that option).

Commodore64user pushed a commit to Commodore64user/KOReader_fork that referenced this pull request Aug 2, 2024
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants