GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — HiDPI on all platforms by sandman7920 · Pull Request #2485 · sqlitebrowser/sqlitebrowser

Conversation

@sandman7920

@sandman7920 sandman7920 commented Nov 21, 2020

Copy link
Copy Markdown
Contributor

Enable HiDPI on all platforms + scalable resources

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

justinclift reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
sandman7920 added 4 commits November 16, 2020 20:42
@sandman7920
Change icons to SVG
8f84e7c
@sandman7920
Change hardcoded resources to aliased one
e9aa318
@sandman7920
Enable HiDPI on all platforms by default
5977837
@sandman7920
Set QToolbar->iconSize globaly to 16px
1ac7015
@justinclift
justinclift requested review from MKleusberg, lucydodo and mgrojo November 22, 2020 02:12
@justinclift

justinclift commented Nov 22, 2020

Copy link
Copy Markdown
Member

@mgrojo @MKleusberg @lucydodo Hoping someone has time to review this?

Most of the testing has been happening in #2469, though we've been more "checking if the result is ok" rather than anyone reviewing the code so far. 😄

lucydodo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justinclift justinclift added the enhancement Feature requests. label Nov 22, 2020
@lucydodo

lucydodo commented Nov 22, 2020

Copy link
Copy Markdown
Member

@justinclift Sorry. I want to do a review, but I don't have any display to test. 😢

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lucydodo
lucydodo removed their request for review November 22, 2020 08:37
@justinclift

justinclift commented Nov 22, 2020

Copy link
Copy Markdown
Member

@lucydodo No worries at all. 😄

As a data point, we've done testing on both macOS and Windows, so we know the result "works ok". But we need someone to look over the code itself and just make sure there aren't any obvious problems before we merge it. 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lucydodo
lucydodo reviewed Nov 22, 2020
View reviewed changes
Comment thread src/main.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920

sandman7920 commented Nov 23, 2020

Copy link
Copy Markdown
Contributor Author

If this PR is accepted icons license must be updated with https://codefisher.org/pastel-svg/ one

lucydodo and justinclift reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lucydodo

lucydodo commented Nov 23, 2020

Copy link
Copy Markdown
Member

That is an important point. Thanks for telling us.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mgrojo

mgrojo commented Dec 21, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

What's the state of this pull request?

I tried to test it and I have a problem with it in my system. It seems to eat up all the available memory and never shows up. It shows these warnings:

qt.svg: link b hasn't been detected!
qt.svg: link b hasn't been detected!
qt.svg: link d hasn't been detected!
qt.svg: link d hasn't been detected!

Regarding the licensing of the icon set, the current set is "Creative Commons Attribution" and the new one is "Creative Commons Attribution NonCommercial Share Alike", which is more restrictive, although still usable. I'm not sure about the consequences, so I just mention it here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justinclift

justinclift commented Dec 22, 2020

Copy link
Copy Markdown
Member

Regarding the licensing of the icon set, the current set is "Creative Commons Attribution" and the new one is "Creative Commons Attribution NonCommercial Share Alike" ...

Oh, that's an important point! Personally, at first thought I don't think that change would have any real consequences for us. We're not a commercial project in any real sense (even with Patreon and similar). But we definitely can email the icon set author to ask, just to be sure. 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920

sandman7920 commented Jan 6, 2021

Copy link
Copy Markdown
Contributor Author

@mgrojo I compiled my SVG branch again on Windows and Linux with Qt 5.15 and everything looks fine.

justinclift reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justinclift

justinclift commented Feb 3, 2021

Copy link
Copy Markdown
Member

On a related point, we're looking to get a HiDPI monitor for testing: #2570

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justinclift

justinclift commented May 26, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@MKleusberg What should be done with this PR? 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@frhun

frhun commented May 28, 2021

Copy link
Copy Markdown

Actually you really don't need a hidpi monitor for testing. (other than the program otherwise maybe not fitting on the monitor)
You only need QT_SCREEN_SCALE_FACTORS="1;1.5;2" which sets a list of scaling factors that is different for every monitor. (in this case 1 for the first, 1.5 for the second, and 2 for the third)
That way you can also very easily test how the program behaves when having to rescale while running and how it responds to fractional scaling

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mgrojo

mgrojo commented May 30, 2021

Copy link
Copy Markdown
Member

I've compiled again, and it runs without problems now, I don't know if it was an incorrect build or that the problem was before updating to Ubuntu 20.4.

I've used the environment variable, and it seems to work, although I don't know where I should pay attention.

In any case, I'm still concerned about the licensing issue. The icon-set license seems more restricted than ours, and the author requires a donation to get the SVG icons, and even then, they ask that you don't redistribute the whole icon set as SVG. Are we going to pay to get future icons? @sandman7920, have you paid to develop this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920

sandman7920 commented May 30, 2021

Copy link
Copy Markdown
Contributor Author

@mgrojo Yes I have paid, also I can provide full iconset.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justinclift

justinclift commented May 30, 2021

Copy link
Copy Markdown
Member

Is the license you're both talking about, the one here?

If so, it says (at this time anyway):

The Pastel SVG icon set Created by Michael Buckley is licensed under the

Creative Commons Attribution NonCommercial Share Alike 4.0 http://creativecommons.org/licenses/by-nc-sa/4.0/

However additionally I would kindly ask that:

1. For non commercial use a link back to the home page is very appreciated but in no way required.
2. If you put Pastel SVG package on another web host in modified form that you provide a link back to the
    Pastel SVG home page as part of the attribution. http://codefisher.org/pastel-svg/

For those that want to use the icons commercially, I ask that you first make a donation and then you may
use it under following license.

Creative Commons Attribution Share Alike 4.0 http://creativecommons.org/licenses/by-sa/4.0/ 

We can do the donation thing there too if it's useful. Our Patreon account generates reasonable funding for things like that. 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mgrojo

mgrojo commented May 30, 2021

Copy link
Copy Markdown
Member

Is the license you're both talking about, the one here?

If so, it says (at this time anyway):

Yes, but it's also this:

Getting the SVG source files

All the of the above downloads only provide the PNG files that are generated from the SVG files that I created. If you would like to use the SVG files, I ask that you make a donation. Please see the donation page for more details. Once you have made the donation you will be able to download them from the Pastel SVG Downloads page.

We can do the donation thing there too if it's useful. Our Patreon account generates reasonable funding for things like that. 😄

Ok, then why not? It's better to have all the blessings if it's reasonable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justinclift

justinclift commented May 31, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Ok, then why not? It's better to have all the blessings if it's reasonable.

Cool. Done. 😄

@codefisher Hopefully that's helpful. 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920
fix indentation (4 spaces)
bb44fc1
@y4rr

y4rr commented Jun 11, 2021

Copy link
Copy Markdown

Please merge this sooner, if you can. Current set of icons makes the experience of using DB Browser on a hi-DPI screen quite unpleasant. You don't need to pay for that specific iconset, any SVG iconset will be a great improvement over the current low-res one.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mgrojo

mgrojo commented Jun 11, 2021

Copy link
Copy Markdown
Member

Ok, let's merge this now. In fact, we've already made a donation to the author, so there is no doubt about the rights. If someone provides a valid alternative icon-set, we can analyse that proposal then, but after some searching I was unable to find a vectorial icon-set as good and publicly available as the original Silk icon-set.

Thanks!

justinclift reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mgrojo
mgrojo merged commit 5b89c2c into sqlitebrowser:master Jun 11, 2021
@sandman7920

sandman7920 commented Jun 14, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There is some strange bug on windows with the system styles (windows and windowsvista).
When styleproxy is used and QDockWidget has a custom stylesheet applied to the widget title, close-button and float-button are rendered huge.

void TableBrowserDock::setFocusStyle(bool on)
{
    // Highlight title bar when dock widget is active
    if(on)
        setStyleSheet("QDockWidget::title {background:palette(highlight);}");
    else
        setStyleSheet(QString());
}

I have created a new series of patches with a workaround for windows and some other tweaks.

Linux has no such issue. Mac and Windows 7 are not tested.

@mgrojo should I make a new PR or more testing is needed?

Nightly
DB4S_nightly

New
DB4S_patchet

justinclift reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mgrojo

mgrojo commented Jun 14, 2021 via email

Copy link
Copy Markdown
Member
Is the active docked tab highlighted over the inactive ones?
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920

sandman7920 commented Jun 14, 2021

Copy link
Copy Markdown
Contributor Author

I have tested Windows 7 and Linux with -style Windows, the problem exists on all platforms with Windows-style applied.

If QProxyStyle is used and QDockWidget has a custom stylesheet on the title element bug exists.

void TableBrowserDock::setFocusStyle(bool on)
{
    // Highlight title bar when dock widget is active
    if(on)
        setStyleSheet("QDockWidget::title {background:palette(highlight);}");
    else
        setStyleSheet(QString());
}

image

workaround

class DB4SProxyStyle final : public QProxyStyle {
public:
    DB4SProxyStyle(int toolBarIconSize, qreal dpi, QStyle *style)
        : QProxyStyle(style), m_toolBarIconSize(toolBarIconSize * dpi / 96)
    {
#ifdef Q_OS_WIN
        m_smallIconSize = 11 * dpi / 96; // WINDOWS THEME BUG

        QStyleOption so(QStyleOption::Version, QStyleOption::SO_MenuItem);
        m_menuItemIconSize = style->pixelMetric(PM_SmallIconSize, &so);
#endif
    }

    int pixelMetric(QStyle::PixelMetric metric,
                    const QStyleOption *option = nullptr,
                    const QWidget *widget = nullptr) const override
    {
        if (metric == PM_ToolBarIconSize) {
            return m_toolBarIconSize;
        }
#ifdef Q_OS_WIN
        else if (metric == PM_SmallIconSize) {
            // set maximum icon size for SmallIcon

            // Set default MenuIcon size
            if (option && option->type == QStyleOption::SO_MenuItem) {
                return m_menuItemIconSize;
            }

            // if we don't return size before QDockWidgets are created,
            // any of the widgets with custom stylesheet are rendered with huge float,close buttons
            // see void TableBrowserDock::setFocusStyle
            return m_smallIconSize;
        }
#endif
        return QProxyStyle::pixelMetric(metric, option, widget);
    }

private:
    int m_toolBarIconSize;
#ifdef Q_OS_WIN
    int m_menuItemIconSize;
    int m_smallIconSize;
#endif
};

Also, in new patches toolBarIconSize calculation is based on screen->logicalDotsPerInch()

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920

sandman7920 commented Jun 14, 2021

Copy link
Copy Markdown
Contributor Author

New QDockWidget::style

void TableBrowserDock::setFocusStyle(bool on)
{
    // Highlight title bar when dock widget is active
    if(on)
        setStyleSheet(QStringLiteral(
            "QDockWidget::title {"
                "background:palette(AlternateBase);"
                "text-align: center;"
                "border-bottom: 2px solid palette(highlight);"
            "}"));
    else
        setStyleSheet(QStringLiteral(
            "QDockWidget::title {"
                "text-align: center;"
            "}"));
}

Windows
image

KDE Breeze
image

KDE DB4S Dark Style
image

KDE DB4S Light Style
image

mgrojo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920

sandman7920 commented Jun 14, 2021

Copy link
Copy Markdown
Contributor Author

Is the active docked tab highlighted over the inactive ones?

Yes it's highlighted

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sandman7920 sandman7920 mentioned this pull request Jun 15, 2021
Workaround for WindowsVista style (qwindowsvistastyle plugin) #2741
Merged
mgrojo added a commit that referenced this pull request Jun 18, 2021
@mgrojo
Merge pull request #2741
0f8b3cc
Workaround for WindowsVista style (qwindowsvistastyle plugin)

There is some strange bug on windows with the system styles (windows
and windowsvista).  When styleproxy is used and QDockWidget has a
custom stylesheet applied to the widget title, close-button and
float-button are rendered huge.

See #2485
@mgrojo mgrojo mentioned this pull request Jul 28, 2024
[Bug]: Missing icons in the menu. #3693
Closed
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lucydodo lucydodo lucydodo left review comments
@mgrojo mgrojo Awaiting requested review from mgrojo
@MKleusberg MKleusberg Awaiting requested review from MKleusberg

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement Feature requests.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@sandman7920 @justinclift @lucydodo @mgrojo @frhun @y4rr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.