-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to hide scrollbars for PDFs #1647
Add option to hide scrollbars for PDFs #1647
Conversation
src/EditAnnotations.cpp
Outdated
@@ -113,7 +113,7 @@ AnnotationType gAnnotsWithColor[] = { | |||
// clang-format on | |||
|
|||
// in SumatraPDF.cpp | |||
extern void WindowInfoRerender(WindowInfo*); | |||
extern void WindowInfoRerender(WindowInfo*, bool = FALSE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using bool, use true / false.
Also, name the bool argument.
The rule is: if the argument is self-explanatory (like WindowInfo*), then we might
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good.
Could you also add context menu `Show Scrollbars" to menuDefContext (like "Show Bookmarks" etc.).
See Menu.cpp and Commands.cpp.
src/EditAnnotations.cpp
Outdated
@@ -113,7 +113,7 @@ AnnotationType gAnnotsWithColor[] = { | |||
// clang-format on | |||
|
|||
// in SumatraPDF.cpp | |||
extern void WindowInfoRerender(WindowInfo*); | |||
extern void WindowInfoRerender(WindowInfo*, bool = FALSE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using bool, use true / false.
Also, name the bool argument.
The rule is: if the argument is self-explanatory (like WindowInfo*), then we might skip naming it. Otherwise, it should be named.
src/DisplayModel.h
Outdated
@@ -135,6 +135,8 @@ struct DisplayModel : public Controller { | |||
void Relayout(float zoomVirtual, int rotation); | |||
|
|||
Rect GetViewPort() const; | |||
bool hScrollbarShown() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more in line with the rest of the code, this should be IsHScrollbarVisible()
src/Canvas.cpp
Outdated
@@ -1312,7 +1330,7 @@ static void OnTimer(WindowInfo* win, HWND hwnd, WPARAM timerId) { | |||
case REPAINT_TIMER_ID: | |||
win->delayedRepaintTimer = 0; | |||
KillTimer(hwnd, REPAINT_TIMER_ID); | |||
win->RedrawAll(); | |||
win->RedrawAllIncludingNonClient(TRUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be true
because it's bool
@@ -44,6 +44,8 @@ struct FixedPageUI { | |||
Vec<COLORREF>* gradientColors; | |||
// if true, TextColor and BackgroundColor will be temporarily swapped | |||
bool invertColors; | |||
// if true, hides the scrollbars but retain ability to scroll | |||
bool hideScrollbars; | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See top of the file. The source of this is in gen_settings_structs.go
. So add it there and then run doit.bat -gen-structs
to regenerate this file. Requires go to be installed.
Sure, let me look into that. |
|
- Ensure consistent usage of lowercase `true` and `false` - Update user settings via do/gen_settings_structs.go - General renaming for consistency
Thanks! |
Is there a release planed with option to hide scrollbars? |
I added an option to hide/show scrollbars for my own use, and thought I'll share it upstream. If this feature is useful, do let me know how the code could be tidied up before merging in.
Details:
HideScrollbars
to the settings, underFixedPageUI
Demonstration:
and with overlap showing key-presses:
Previous discussions: