Acced new module TextBrowser

Created modules folder for the MainWindow modules.
Morphed Craplog's LogFilesTB into MainWindow module TextBrowser.
This commit is contained in:
Valentino Orlandi 2022-06-27 21:54:45 +02:00
parent 05d72d36fc
commit 62c5e61dca
Signed by: elB4RTO
GPG key ID: 1719E976DB2D4E71
3 changed files with 110 additions and 0 deletions

6
craplog/modules.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef MODULES_H
#define MODULES_H
#include "modules/tb.h"
#endif // MODULES_H

67
craplog/modules/tb.cpp Normal file
View file

@ -0,0 +1,67 @@
#include "tb.h"
TextBrowser::TextBrowser()
{
}
bool TextBrowser::getWideLinesUsage()
{
return this->wide_lines;
}
int TextBrowser::getColorSchemeID()
{
return this->color_scheme_id;
}
std::unordered_map<std::string, QString> TextBrowser::getColorScheme()
{
return this->color_scheme;
}
int TextBrowser::getFontSize()
{
return this->font_size;
}
QString TextBrowser::getFontFamily()
{
return this->font_family;
}
QFont TextBrowser::getFont()
{
return this->font;
}
// setters
void TextBrowser::setWideLinesUsage( bool use_wide_lines )
{
this->wide_lines = use_wide_lines;
}
void TextBrowser::setColorScheme( int color_scheme_id, std::unordered_map<std::string, QString> color_scheme )
{
this->color_scheme_id = color_scheme_id;
this->color_scheme = color_scheme;
}
void TextBrowser::setFontSize( int font_size )
{
this->font_size = font_size;
}
void TextBrowser::setFontFamily( QString font_family )
{
this->font_family = font_family;
}
void TextBrowser::setFont( QFont font )
{
this->font = font;
}

37
craplog/modules/tb.h Normal file
View file

@ -0,0 +1,37 @@
#ifndef LOGFILESTB_H
#define LOGFILESTB_H
#include "qfont.h"
class TextBrowser
{
public:
TextBrowser();
// getters
bool getWideLinesUsage();
int getColorSchemeID();
std::unordered_map<std::string, QString> getColorScheme();
int getFontSize();
QString getFontFamily();
QFont getFont();
// setters
void setWideLinesUsage( bool use_wide_lines );
void setColorScheme( int color_scheme_id, std::unordered_map<std::string, QString> color_scheme );
void setFontSize( int font_size );
void setFontFamily( QString font_family );
void setFont( QFont font );
private:
bool wide_lines = false;
int color_scheme_id = 1;
std::unordered_map<std::string, QString> color_scheme;
int font_size = 13;
QString font_family;
QFont font;
};
#endif // LOGFILESTB_H