From 7ee008e150bc5bcf76082d726f719ee0fdfda982 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 11 Feb 2026 02:37:39 -0600 Subject: Fluorine Manager: full Linux port of Mod Organizer 2 Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 --- .../MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp | 165 +++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp (limited to 'libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp') diff --git a/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp new file mode 100644 index 0000000..d686c58 --- /dev/null +++ b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp @@ -0,0 +1,165 @@ +#include "checkboxwordwrap.h" + +#include +#include + +CheckBoxWordWrap::CheckBoxWordWrap(QWidget *parent) + : QCheckBox (parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(this)) +{ + init(); +} + +CheckBoxWordWrap::CheckBoxWordWrap(const QString &text, QWidget *parent) + : QCheckBox (parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(text, this)) +{ + init(); +} + +CheckBoxWordWrap::~CheckBoxWordWrap() +{ + delete m_label; + delete m_hMainLayout; +} + +bool CheckBoxWordWrap::isWordWrap() const +{ + return m_label->wordWrap(); +} + +void CheckBoxWordWrap::setWordWrap(bool wordwrap) +{ + m_label->setWordWrap(wordwrap); +} + +QString CheckBoxWordWrap::text() const +{ + return m_label->text(); +} + +void CheckBoxWordWrap::setText(const QString &text) +{ + m_label->setText(text); +} + +QSize CheckBoxWordWrap::sizeHint() const +{ + QFontMetrics fm(m_label->font()); + QRect r = m_label->rect(); + r.setLeft(r.left()+m_label->indent()+separation); + QRect bRect = fm.boundingRect(r, int(Qt::AlignLeft | Qt::AlignVCenter | Qt::TextWordWrap), m_label->text()); + QSize ret = QSize(QWidget::sizeHint().width(), bRect.height()); + return ret; +} + +void CheckBoxWordWrap::labelIsClicked() +{ + setChecked(!isChecked()); +} + +void CheckBoxWordWrap::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + updateGeometry(); +} + +void CheckBoxWordWrap::init() +{ + setLayout(m_hMainLayout); + QStyleOptionButton opt; + initStyleOption(&opt); + int indicatorW = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorWidth, &opt, this); + // Useless in our case, we only need the indicator width + //int indicatorH = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorHeight, &opt, this); + m_hMainLayout->setContentsMargins(0, 0, 0, 0); + m_hMainLayout->addWidget(m_label); + m_label->setIndent(indicatorW+separation); + m_label->setWordWrap(true); + + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + connect(m_label, SIGNAL(clicked()), this, SLOT(labelIsClicked())); +} + + +RadioButtonWordWrap::RadioButtonWordWrap(QWidget* parent) + : QRadioButton(parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(this)) +{ + init(); +} + +RadioButtonWordWrap::RadioButtonWordWrap(const QString& text, QWidget* parent) + : QRadioButton(parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(text, this)) +{ + init(); +} + +RadioButtonWordWrap::~RadioButtonWordWrap() +{ + delete m_label; + delete m_hMainLayout; +} + +bool RadioButtonWordWrap::isWordWrap() const +{ + return m_label->wordWrap(); +} + +void RadioButtonWordWrap::setWordWrap(bool wordwrap) +{ + m_label->setWordWrap(wordwrap); +} + +QString RadioButtonWordWrap::text() const +{ + return m_label->text(); +} + +void RadioButtonWordWrap::setText(const QString& text) +{ + m_label->setText(text); +} + +QSize RadioButtonWordWrap::sizeHint() const +{ + QFontMetrics fm(m_label->font()); + QRect r = m_label->rect(); + r.setLeft(r.left() + m_label->indent() + separation); + QRect bRect = fm.boundingRect(r, int(Qt::AlignLeft | Qt::AlignVCenter | Qt::TextWordWrap), m_label->text()); + QSize ret = QSize(QWidget::sizeHint().width(), bRect.height()); + return ret; +} + +void RadioButtonWordWrap::labelIsClicked() +{ + setChecked(!isChecked()); +} + +void RadioButtonWordWrap::resizeEvent(QResizeEvent* event) +{ + QWidget::resizeEvent(event); + updateGeometry(); +} + +void RadioButtonWordWrap::init() +{ + setLayout(m_hMainLayout); + QStyleOptionButton opt; + initStyleOption(&opt); + int indicatorW = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorWidth, &opt, this); + // Useless in our case, we only need the indicator width + //int indicatorH = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorHeight, &opt, this); + m_hMainLayout->setContentsMargins(0, 0, 0, 0); + m_hMainLayout->addWidget(m_label); + m_label->setIndent(indicatorW + separation); + m_label->setWordWrap(true); + + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + connect(m_label, SIGNAL(clicked()), this, SLOT(labelIsClicked())); +} -- cgit v1.3.1