mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-08 22:46:31 +03:00
Fix in the key events received by the UICodeEditor. Reimplemented TextDocument::insert to improve performance. Dragged Tab relative position fix. Removed incorrect KeyDown event. Minor UI tweaks.
77 lines
1.5 KiB
C++
77 lines
1.5 KiB
C++
#ifndef EE_UI_CSS_STYLESHEETLENGTH_HPP
|
|
#define EE_UI_CSS_STYLESHEETLENGTH_HPP
|
|
|
|
#include <eepp/config.hpp>
|
|
#include <eepp/math/size.hpp>
|
|
#include <eepp/scene/scenenode.hpp>
|
|
#include <string>
|
|
|
|
using namespace EE::Math;
|
|
|
|
namespace EE { namespace UI { namespace CSS {
|
|
|
|
class EE_API StyleSheetLength {
|
|
public:
|
|
enum Unit {
|
|
Percentage,
|
|
In,
|
|
Cm,
|
|
Mm,
|
|
Em,
|
|
Ex,
|
|
Pt,
|
|
Pc,
|
|
Px,
|
|
Dpi,
|
|
Dp,
|
|
Dpcm,
|
|
Vw,
|
|
Vh,
|
|
Vmin,
|
|
Vmax,
|
|
Rem,
|
|
};
|
|
|
|
static Unit unitFromString( std::string unitStr );
|
|
|
|
static std::string unitToString( const Unit& unit );
|
|
|
|
StyleSheetLength();
|
|
|
|
StyleSheetLength( const Float& val, const Unit& unit );
|
|
|
|
StyleSheetLength( std::string val, const Float& defaultValue = 0 );
|
|
|
|
StyleSheetLength( const StyleSheetLength& val );
|
|
|
|
void setValue( const Float& val, const Unit& units );
|
|
|
|
const Float& getValue() const;
|
|
|
|
const Unit& getUnit() const;
|
|
|
|
Float asPixels( const Float& parentSize, const Sizef& viewSize, const Float& displayDpi,
|
|
const Float& elFontSize = 12, const Float& globalFontSize = 12 ) const;
|
|
|
|
Float asDp( const Float& parentSize, const Sizef& viewSize, const Float& displayDpi,
|
|
const Float& elFontSize = 12, const Float& globalFontSize = 12 ) const;
|
|
|
|
bool operator==( const StyleSheetLength& val );
|
|
|
|
StyleSheetLength& operator=( const StyleSheetLength& val );
|
|
|
|
StyleSheetLength& operator=( const Float& val );
|
|
|
|
static StyleSheetLength fromString( std::string str, const Float& defaultValue = 0 );
|
|
|
|
std::string toString() const;
|
|
|
|
protected:
|
|
Unit mUnit;
|
|
Float mValue;
|
|
};
|
|
|
|
}}} // namespace EE::UI::CSS
|
|
|
|
#endif
|