Skip to content

Commit

Permalink
Slightly decrease the text icon size.
Browse files Browse the repository at this point in the history
It seems that for certain font it is still possible to be too big and
clip the text as a result.
  • Loading branch information
wengxt committed Jun 29, 2024
1 parent b1865c0 commit aec50f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ui/classic/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,13 @@ ThemeImage::ThemeImage(const std::string &name, const ActionImageConfig &cfg) {
void ThemeImage::drawTextIcon(cairo_surface_t *surface,
const std::string &rawLabel, uint32_t size,
const ClassicUIConfig &config) {

auto [label, textWidth] = extractTextForLabel(rawLabel);
auto *cr = cairo_create(surface);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairoSetSourceColor(cr, Color("#00000000"));
cairo_paint(cr);

int pixelSize = size * 0.75 * (textWidth >= 3 ? (2.0 / textWidth) : 1.0);
int pixelSize = size * 0.7 * (textWidth >= 3 ? (2.0 / textWidth) : 1.0);
if (pixelSize < 0) {
pixelSize = 1;
}
Expand Down

0 comments on commit aec50f3

Please sign in to comment.