Code Monkey home page Code Monkey logo

Comments (5)

nitramr avatar nitramr commented on August 24, 2024 1

Something like that?
https://github.com/nitramr/scribus-indigo/wiki/Customize-Scribus

from scribus-indigo.

luzpaz avatar luzpaz commented on August 24, 2024

Can we use SVGs for icons as well ? They are more HiDPI friendly, right ?

from scribus-indigo.

nitramr avatar nitramr commented on August 24, 2024

Good idea. To achieve it we can modifiy the iconmanager.cpp and load SVG's via:

http://doc.qt.io/qt-5/qsvgrenderer.html

QSvgRenderer svgRenderer( somesvgfile );
QPixmap pix( svgRenderer.defaultSize() ); // scale factor has to be applied
QPainter pixPainter( &pix );
svgRenderer.render( &pixPainter );

Based on this 'pix' Pixmap we can generate new QIcons with enabled / disabled states (as I used it for my themes). Based on screen type we can set a scale factor by generating the new QPixmaps.

I will make some tests to check it out.

But one hint at this point. We have to check if we can use the same svg file for 16px* icons and 32px* icons because of level of details. Maybe we still would need two different versions. (16px* and grater than 16px*).

*) pixel sizes demonstrate the relative scaling between icons.

from scribus-indigo.

nitramr avatar nitramr commented on August 24, 2024

It is simplier as expected. Qpixmap can load nativly a SVG file. I have made a test with pages panel icon here: a878962

Bad thing of using SVG files is the file size. Regular png icon need ca 300 byte, SVG icon need 3,5KB
In latest commit there is still a scale factor missing to render the icon in right size.

My idea would be to set a normal render size by loading of any icon. Based on screen type it can by multiplied by 2.

@luzpaz do we have svg files for all used Scribus icons? If yes I can make some more tests for icons in different sizes (16px, 22px, 32px etc.)

from scribus-indigo.

luzpaz avatar luzpaz commented on August 24, 2024

opened a ticket at https://bugs.scribus.net/view.php?id=14528

from scribus-indigo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.