frontend: Add InfoChip widget

A new simple widget for displaying small bits of text.
This commit is contained in:
Warchamp7
2026-09-23 18:53:19 -04:00
committed by Ryan Foster
parent da8745ac33
commit 08069bd01a
4 changed files with 111 additions and 5 deletions
+2
View File
@@ -44,6 +44,8 @@ target_sources(
components/FocusList.hpp
components/GameCaptureToolbar.cpp
components/GameCaptureToolbar.hpp
components/InfoChip.cpp
components/InfoChip.hpp
components/ImageSourceToolbar.cpp
components/ImageSourceToolbar.hpp
components/MediaControls.cpp
+28
View File
@@ -0,0 +1,28 @@
/******************************************************************************
Copyright (C) 2026 by Warchamp7 <warchamp7@obsproject.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include "InfoChip.hpp"
InfoChip::InfoChip(QWidget *parent) : QLabel(parent)
{
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
}
InfoChip::InfoChip(const QString &text, QWidget *parent) : InfoChip(parent)
{
setText(text);
}
+28
View File
@@ -0,0 +1,28 @@
/******************************************************************************
Copyright (C) 2026 by Warchamp7 <warchamp7@obsproject.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#pragma once
#include <QLabel>
class InfoChip : public QLabel {
Q_OBJECT
public:
explicit InfoChip(QWidget *parent);
explicit InfoChip(const QString &text, QWidget *parent);
};
+53 -5
View File
@@ -111,9 +111,6 @@
--primary_dark: var(--blue4);
--primary_darker: var(--blue5);
--warning: var(--yellow3);
--danger: var(--red3);
--text: var(--white1);
--text_light: var(--white1);
--text_muted: var(--white5);
@@ -303,6 +300,30 @@
background-color: var(--bg_base);
}
.bg-primary {
background-color: var(--primary);
}
.bg-secondary {
background-color: var(--teal3);
}
.bg-info {
background-color: var(--grey8);
}
.bg-warning {
background-color: var(--yellow6);
}
.bg-danger {
background-color: var(--red6);
}
.bg-success {
background-color: var(--green6);
}
.text-title {
font-size: var(--font_large);
font-weight: bold;
@@ -342,17 +363,37 @@
}
.text-warning {
color: var(--warning);
color: var(--yellow3);
}
.text-danger {
color: var(--danger);
color: var(--red3);
}
.text-success {
color: var(--green3);
}
.bg-secondary.text-secondary {
color: var(--teal1);
}
.bg-info.text-info {
color: var(--text_light);
}
.bg-warning.text-warning {
color: var(--yellow1);
}
.bg-danger.text-danger {
color: var(--red1);
}
.bg-success.text-success {
color: var(--green1);
}
.frame-notice {
background: var(--grey8);
border: 1px solid var(--grey6);
@@ -2517,6 +2558,13 @@ SourceSelectButton:pressed:hover {
border-color: var(--button_border);
}
InfoChip {
font-size: var(--font_small);
font-weight: bold;
padding: 0 var(--padding_large);
border-radius: var(--border_radius);
}
/* Idian Widgets */
idian--ListHeader {
border-radius: var(--border_radius);