kcontrol: convert fonts KCM pixmaps to PNG

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-20 22:42:50 +03:00
parent fb58f737d6
commit bda0575c44
6 changed files with 25 additions and 71 deletions

View file

@ -44,3 +44,12 @@ install(
FILES fonts.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)
install(
FILES
data/aa_rgb.png
data/aa_bgr.png
data/aa_vrgb.png
data/aa_vbgr.png
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kcminput/pics
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

View file

@ -60,76 +60,21 @@
#undef None
#endif
static const char * const aa_rgb_xpm[]={
"12 12 3 1",
"a c #0000ff",
"# c #00ff00",
". c #ff0000",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa"};
static const char * const aa_bgr_xpm[]={
"12 12 3 1",
". c #0000ff",
"# c #00ff00",
"a c #ff0000",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa",
"....####aaaa"};
static const char * const aa_vrgb_xpm[]={
"12 12 3 1",
"a c #0000ff",
"# c #00ff00",
". c #ff0000",
"............",
"............",
"............",
"............",
"############",
"############",
"############",
"############",
"aaaaaaaaaaaa",
"aaaaaaaaaaaa",
"aaaaaaaaaaaa",
"aaaaaaaaaaaa"};
static const char * const aa_vbgr_xpm[]={
"12 12 3 1",
". c #0000ff",
"# c #00ff00",
"a c #ff0000",
"............",
"............",
"............",
"............",
"############",
"############",
"############",
"############",
"aaaaaaaaaaaa",
"aaaaaaaaaaaa",
"aaaaaaaaaaaa",
"aaaaaaaaaaaa"};
static const char* const * const aaPixmaps[]={ aa_rgb_xpm, aa_bgr_xpm, aa_vrgb_xpm, aa_vbgr_xpm };
static QPixmap aaPixmap(const int t)
{
static const char* const aaPixmaps[] = {
"kcminput/pics/aa_rgb.png",
"kcminput/pics/aa_bgr.png",
"kcminput/pics/aa_vrgb.png",
"kcminput/pics/aa_vbgr.png",
};
const QString pixmapfilepath = KGlobal::dirs()->findResource("data", aaPixmaps[t]);
if (pixmapfilepath.isEmpty()) {
kWarning() << "No image for" << aaPixmaps[t];
return QPixmap();
}
return QPixmap(pixmapfilepath);
}
/**** DLL Interface ****/
K_PLUGIN_FACTORY(FontFactory, registerPlugin<KFonts>(); )
@ -264,7 +209,7 @@ FontAASettings::FontAASettings(QWidget *parent)
subPixelType->setWhatsThis( subPixelWhatsThis );
for(int t=KXftConfig::SubPixel::None+1; t<=KXftConfig::SubPixel::Vbgr; ++t)
subPixelType->addItem(QPixmap(aaPixmaps[t-1]), i18n(KXftConfig::description((KXftConfig::SubPixel::Type)t).toUtf8()));
subPixelType->addItem(aaPixmap(t-1), i18n(KXftConfig::description((KXftConfig::SubPixel::Type)t).toUtf8()));
QLabel *hintingLabel=new QLabel(i18n("Hinting style: "), mw);
hintingStyle=new QComboBox(mw);