File indexing completed on 2024-12-22 05:01:16
0001 /* 0002 SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "zoomlabelwidget.h" 0008 #include <KLocalizedString> 0009 0010 ZoomLabelWidget::ZoomLabelWidget(QWidget *parent) 0011 : QLabel(parent) 0012 { 0013 } 0014 0015 ZoomLabelWidget::~ZoomLabelWidget() = default; 0016 0017 void ZoomLabelWidget::setZoom(qreal zoomFactor) 0018 { 0019 if (zoomFactor != 100.0) { 0020 setText(i18n("Zoom: %1%", zoomFactor)); 0021 show(); 0022 } else { 0023 hide(); 0024 } 0025 } 0026 0027 #include "moc_zoomlabelwidget.cpp"