mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-12 21:35:49 +00:00
initial plasma6 support
This commit is contained in:
75
sources/3rdparty/fontdialog/fontdialog.cpp
vendored
75
sources/3rdparty/fontdialog/fontdialog.cpp
vendored
@ -39,81 +39,6 @@ void CFont::setCurrentColor(const QColor color)
|
||||
}
|
||||
|
||||
|
||||
int CFont::html2QFont(const int htmlWeight)
|
||||
{
|
||||
int weight = 16;
|
||||
switch(htmlWeight) {
|
||||
case 100:
|
||||
weight = 16;
|
||||
break;
|
||||
case 200:
|
||||
case 300:
|
||||
weight = 25;
|
||||
break;
|
||||
case 400:
|
||||
weight = 50;
|
||||
break;
|
||||
case 500:
|
||||
case 600:
|
||||
weight = 63;
|
||||
break;
|
||||
case 700:
|
||||
case 800:
|
||||
weight = 75;
|
||||
break;
|
||||
case 900:
|
||||
weight = 87;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return weight;
|
||||
}
|
||||
|
||||
|
||||
int CFont::qFont2html(const int weight)
|
||||
{
|
||||
int htmlWeight = 400;
|
||||
switch(weight) {
|
||||
case 16:
|
||||
htmlWeight = 100;
|
||||
break;
|
||||
case 25:
|
||||
htmlWeight = 300;
|
||||
break;
|
||||
case 50:
|
||||
htmlWeight = 400;
|
||||
break;
|
||||
case 63:
|
||||
htmlWeight = 600;
|
||||
break;
|
||||
case 75:
|
||||
htmlWeight = 800;
|
||||
break;
|
||||
case 87:
|
||||
htmlWeight = 900;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return htmlWeight;
|
||||
}
|
||||
|
||||
|
||||
int CFont::htmlWeight()
|
||||
{
|
||||
return CFont::qFont2html(weight());
|
||||
}
|
||||
|
||||
|
||||
void CFont::setHtmlWeight(const int htmlWeight)
|
||||
{
|
||||
setWeight(CFont::html2QFont(htmlWeight));
|
||||
}
|
||||
|
||||
|
||||
CFont CFont::fromQFont(const QFont font, const QColor color)
|
||||
{
|
||||
return CFont(font.family(), font.pointSize(), font.weight(), font.italic(), color);
|
||||
|
Reference in New Issue
Block a user