Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit d679b3c9 authored by Alexey Demennikov's avatar Alexey Demennikov Committed by Henrik Fehlauer

Set the columns in "Overview" mode to match the amount of pages if document is small

Summary:
FEATURE: 355283

The principle is simple. This patch enables overriding the default columns for Overview mode, if the document is small. For example, if document has 1 or 2 pages and the default columns in Okular settings is 3, Overview mode will enable 1 or 2 columns for better UX

Reviewers: #okular, rkflx, ngraham

Reviewed By: rkflx, ngraham

Subscribers: ltoscano, aacid, rkflx, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8385
parent 7d656d53
......@@ -4181,6 +4181,9 @@ int PageView::viewColumns() const
if (vm == Okular::Settings::EnumViewMode::Single) return 1;
else if (vm == Okular::Settings::EnumViewMode::Facing ||
vm == Okular::Settings::EnumViewMode::FacingFirstCentered) return 2;
else if (vm == Okular::Settings::EnumViewMode::Summary
&& d->document->pages() < Okular::Settings::viewColumns() )
return d->document->pages();
else return Okular::Settings::viewColumns();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment