1. 22 Jun, 2022 3 commits
  2. 19 Jun, 2022 1 commit
  3. 18 Jun, 2022 5 commits
  4. 15 Jun, 2022 2 commits
  5. 14 Jun, 2022 6 commits
  6. 22 May, 2022 1 commit
  7. 04 May, 2022 1 commit
  8. 13 Apr, 2022 1 commit
  9. 05 Apr, 2022 1 commit
  10. 29 Mar, 2022 1 commit
  11. 24 Mar, 2022 1 commit
  12. 22 Mar, 2022 1 commit
  13. 21 Mar, 2022 1 commit
  14. 20 Mar, 2022 1 commit
  15. 14 Mar, 2022 1 commit
    • snooxx's avatar
      KgThemeProvider: Smooth previews · 0aab524a
      snooxx authored
      Some KDE Games allow to switch between different themes. The theme
      selector shows previews, based on pixmaps which are scaled down to fit
      within the available UI space. By default `Qt::FastTransformation` is
      used within `KgThemeSelector`, however this can result in subpar image
      quality, even for non-HiDPI use cases.
      
      Changing the scaling method to `Qt::SmoothTransformation` improves the
      look of the previews. Since `generatePreview` is not exactly a hot code
      path, performance implications of the change should not be an issue.
      
      Note: The similar class `KGameThemeSelector` is already using
      `Qt::SmoothTransformation` for its previews.
      
      Test Plan:
      
      Open KPatience, "Settings -> Change Appearance -> Game Theme" now shows
      less blocky previews.
      0aab524a
  16. 13 Mar, 2022 1 commit
    • snooxx's avatar
      KGameThemeSelector: Fix preview in HiDPI mode · f4e27ac1
      snooxx authored
      A couple of KDE games allow to choose between different themes via their
      settings menu. While HiDPI-rendering of the theme itself is SVG based
      and already fixed in at least some of the games, the theme selection
      dialog still only showed a pixelated preview. Note that only games using
      `KGameThemeSelector` are affected (e.g. KBlocks, KSudoku), as games
      relying on `KgThemeSelector` (e.g. KPatience, KMines) where already
      fixed in 6047bc31.
      
      Even if the preview is based on a static PNG image, by setting the
      proper `devicePixelRatio` for the pixmap the image quality of the
      preview can be considerably improved already.
      
      Test Plan:
      
      Launch `QT_SCALE_FACTOR=1.4 kblocks`, "Settings -> Theme -> Preview"
      should not be pixelated anymore.
      f4e27ac1
  17. 12 Mar, 2022 1 commit
    • snooxx's avatar
      KGamePopupItem: Fix icon and text alignment in HiDPI mode · 7b9e6f03
      snooxx authored
      When running a game in HiDPI mode, the icon within the popup message
      would not be vertically centered anymore, and the distance between icon
      and text would be too large.
      
      This is caused by the message itself getting too large, due to
      calculations using the dimensions of the icon's pixmap in device pixels.
      
      By converting the icon pixmap size to device independent pixels, the
      popup message is correctly sized again, leading to correct alignment of
      icon and text as well.
      
      Test Plan:
      
      Launch `QT_SCALE_FACTOR=2.4 kblocks`, check centered alignment of icon
      and text in popup messages after startup and when pausing/resuming.
      7b9e6f03
  18. 11 Mar, 2022 1 commit
    • snooxx's avatar
      KGamePopupItem: Use fixed offset from canvas border · 5b7bd359
      snooxx authored
      Popup messages do not scale in size along with the canvas fitting into
      its viewport, to keep the text readable regardless of screen size. Still
      their distance to the canvas border (`SHOW_OFFSET`) would change when
      resizing the game window.
      
      This is due to the offset being specified in screen pixels, while
      calculations the offset is used in are expecting scene coordinates.
      
      Conversion via `mapToScene` will make the offset constant. The offset
      itself is also increased to a more pleasing distance (the old offset
      changed depending on window size, therefore it is hard to judge what the
      original intention was).
      
      Note that dimensions are given in device independent pixels, so
      the offset scales up automatically for HiDPI use cases.
      
      Test Plan:
      
      Start a new game in KBlocks and resize the window. The message when
      pausing the game should have the same offset from the window border as
      the welcome message, and the offset should be visually matching the
      popup's inner margin.
      5b7bd359
  19. 10 Mar, 2022 1 commit
    • snooxx's avatar
      KGamePopupItem: Fix incorrect positioning relative to canvas · 5adee9b5
      snooxx authored
      `KGamePopupItem` can be used to show popup messages overlayed over the
      game's canvas, appearing as specified in one of the four corners or in
      the center. While this worked fine for `Position::TopLeft`, positioning
      for the other locations could be wrong, e.g. too far off from the right
      border, cut off, or not perfectly centered. In particular positioning
      relative to the edges of the canvas also incorrectly depended on canvas
      size and aspect ratio, while the popup message should always be placed
      adjacent to the respective edges of the canvas.
      
      This is because dimensions in physical/screen pixels are used in
      calculations to determine the position, while drawing is tied to scene
      coordinates, which can have different scaling depending on how the
      canvas has been scaled to fit within the viewport.
      
      By properly mapping on-screen dimensions of the popup message to scene
      coordinates via `mapToScene`, popup messages show up in their correct
      locations again. Note that popup messages are not supposed to scale
      along with the rest of the game content, to keep them readable
      regardless of screen size.
      
      This patch is also required to be able to properly test later HiDPI fixes.
      
      Test Plan:
      
      In KBlocks, change `KBlocksScene::showMessage` to use `TopLeft`,
      `TopRight`, `BottomLeft`, `BottomRight` and `Center`. Starting a new
      game and pausing/resuming now shows popup messages which are not
      cut off, properly adjacent to the canvas border, and perfectly centered.
      5adee9b5
  20. 20 Mar, 2022 1 commit
  21. 08 Mar, 2022 1 commit
  22. 07 Mar, 2022 1 commit
  23. 10 Feb, 2022 1 commit
  24. 03 Feb, 2022 1 commit
  25. 31 Jan, 2022 1 commit
  26. 21 Jan, 2022 1 commit
  27. 18 Jan, 2022 1 commit
  28. 17 Jan, 2022 1 commit