Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Krita Krita
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Bugzilla
    • Bugzilla
  • Merge requests 72
    • Merge requests 72
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • GraphicsGraphics
  • KritaKrita
  • Merge requests
  • !1344

Zoom fit with margins

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Freya Lupen requested to merge freyalupen/krita:freyalupen/zoom-fit-margin into master Feb 21, 2022
  • Overview 5
  • Commits 5
  • Pipelines 10
  • Changes 13

(Tell us what you did!)

This is an amateur attempt at implementing a "beginner coding task"; features mentioned in BUG#381537 "Zoom fit with margins?".

  1. It adds margins to the canvas when using a fit-to-page zoom mode, with the width being configurable in the settings dialog.
  2. It adds an action to toggle between the current fit-to-page mode and the previous constant zoom level.

The features seem to work, but I don't know much about code and UI quality/style and those most likely need changes. (In fact, the UI is not as intended because I made a mistake merging code, and I apologize for that.)

Test Plan

(Tell us how to test the changes you made.)

Open an image.

  1. Configure the margin in the settings under General/Tools. Set the zoom level to fit page/width/height and confirm there is a margin of the proper width.
  2. Configure a hotkey for the Toggle Zoom Fit to Page action (` for example). Change the zoom level and invoke the action to confirm toggling between constant and fit-page zoom levels.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited Feb 24, 2022 by Dmitry Kazakov
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: freyalupen/zoom-fit-margin