mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-02 11:10:31 +03:00
Added String::formatBuffer for char32_t strings.
Minor fixes in breeze theme.
This commit is contained in:
@@ -143,6 +143,8 @@ DropDownList {
|
|||||||
border-radius: var(--button-radius);
|
border-radius: var(--button-radius);
|
||||||
border-width: var(--border-width);
|
border-width: var(--border-width);
|
||||||
transition: all 0.125s cubic-bezier(0.77, 0.77, 0.38, 0.38);
|
transition: all 0.125s cubic-bezier(0.77, 0.77, 0.38, 0.38);
|
||||||
|
color: var(--font);
|
||||||
|
tint: var(--font);
|
||||||
}
|
}
|
||||||
|
|
||||||
DropDownList,
|
DropDownList,
|
||||||
@@ -166,6 +168,8 @@ SelectButton:pressed,
|
|||||||
SelectButton:selected,
|
SelectButton:selected,
|
||||||
SelectButton:selected:pressed {
|
SelectButton:selected:pressed {
|
||||||
background-color: var(--primary);
|
background-color: var(--primary);
|
||||||
|
color: var(--list-row-active);
|
||||||
|
tint: var(--list-row-active);
|
||||||
}
|
}
|
||||||
|
|
||||||
pushbutton:disabled,
|
pushbutton:disabled,
|
||||||
@@ -306,6 +310,8 @@ DropDownList::ListBox::item,
|
|||||||
ComboBox::DropDownList::ListBox::item {
|
ComboBox::DropDownList::ListBox::item {
|
||||||
padding-left: 4dp;
|
padding-left: 4dp;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
color: var(--font);
|
||||||
|
tint: var(--font);
|
||||||
}
|
}
|
||||||
|
|
||||||
DropDownList::ListBox::item:hover,
|
DropDownList::ListBox::item:hover,
|
||||||
@@ -313,6 +319,8 @@ DropDownList::ListBox::item:selected,
|
|||||||
ComboBox::DropDownList::ListBox::item:hover,
|
ComboBox::DropDownList::ListBox::item:hover,
|
||||||
ComboBox::DropDownList::ListBox::item:selected {
|
ComboBox::DropDownList::ListBox::item:selected {
|
||||||
background-color: var(--primary);
|
background-color: var(--primary);
|
||||||
|
color: var(--list-row-active);
|
||||||
|
tint: var(--list-row-active);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextInput,
|
TextInput,
|
||||||
@@ -937,7 +945,7 @@ listview::header::column:hover,
|
|||||||
tableview::rowheader::row:hover,
|
tableview::rowheader::row:hover,
|
||||||
treeview::rowheader::row:hover,
|
treeview::rowheader::row:hover,
|
||||||
listview::rowheader::row:hover {
|
listview::rowheader::row:hover {
|
||||||
background-color: var(--item-hover);
|
background-color: var(--item-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
tableview::row,
|
tableview::row,
|
||||||
|
|||||||
@@ -509,6 +509,10 @@ class EE_API String {
|
|||||||
/** Format a char buffer */
|
/** Format a char buffer */
|
||||||
static void formatBuffer( char* Buffer, int BufferSize, const char* format, ... );
|
static void formatBuffer( char* Buffer, int BufferSize, const char* format, ... );
|
||||||
|
|
||||||
|
/** Format a UTF-32 buffer */
|
||||||
|
static String::View formatBuffer( String::StringBaseType* Buffer, int BufferSize,
|
||||||
|
const char* format, ... );
|
||||||
|
|
||||||
/** @brief Construct from an UTF-8 string to UTF-32 according
|
/** @brief Construct from an UTF-8 string to UTF-32 according
|
||||||
** @param utf8String UTF-8 string to convert
|
** @param utf8String UTF-8 string to convert
|
||||||
**/
|
**/
|
||||||
@@ -1175,6 +1179,7 @@ class EE_API String {
|
|||||||
* @param str The string to strip
|
* @param str The string to strip
|
||||||
*/
|
*/
|
||||||
static void stripAnsiCodes( std::string& str );
|
static void stripAnsiCodes( std::string& str );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend EE_API bool operator==( const String& left, const String& right );
|
friend EE_API bool operator==( const String& left, const String& right );
|
||||||
friend EE_API bool operator<( const String& left, const String& right );
|
friend EE_API bool operator<( const String& left, const String& right );
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <memory_resource>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
#include <cpp-unicodelib/unicodelib.h>
|
#include <cpp-unicodelib/unicodelib.h>
|
||||||
@@ -1616,6 +1617,40 @@ void String::formatBuffer( char* Buffer, int BufferSize, const char* format, ...
|
|||||||
va_end( args );
|
va_end( args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String::View String::formatBuffer( String::StringBaseType* Buffer, int BufferSize,
|
||||||
|
const char* format, ... ) {
|
||||||
|
static constexpr std::size_t PMR_LOCAL_BUFFER_SIZE = 512;
|
||||||
|
alignas( std::max_align_t ) std::array<std::byte, PMR_LOCAL_BUFFER_SIZE> stack_buffer;
|
||||||
|
std::pmr::monotonic_buffer_resource mbr( stack_buffer.data(), stack_buffer.size(),
|
||||||
|
std::pmr::get_default_resource() );
|
||||||
|
std::pmr::vector<char> pmrBuf( static_cast<std::size_t>( BufferSize ), &mbr );
|
||||||
|
if ( !pmrBuf.empty() )
|
||||||
|
pmrBuf[0] = '\0';
|
||||||
|
va_list args;
|
||||||
|
va_start( args, format );
|
||||||
|
int result_len = 0;
|
||||||
|
#ifdef EE_COMPILER_MSVC
|
||||||
|
result_len = _vsnprintf_s( pmrBuf.data(), pmrBuf.size(), pmrBuf.size() - 1, format, args );
|
||||||
|
if ( result_len < 0 && !pmrBuf.empty() ) {
|
||||||
|
pmrBuf.back() = '\0';
|
||||||
|
result_len = static_cast<int>( pmrBuf.size() - 1 );
|
||||||
|
} else if ( result_len < 0 ) {
|
||||||
|
result_len = 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
result_len = vsnprintf( pmrBuf.data(), pmrBuf.size(), format, args );
|
||||||
|
if ( result_len >= static_cast<int>( pmrBuf.size() ) ) {
|
||||||
|
result_len = static_cast<int>( pmrBuf.size() - 1 );
|
||||||
|
} else if ( result_len < 0 ) {
|
||||||
|
result_len = 0;
|
||||||
|
if ( !pmrBuf.empty() )
|
||||||
|
pmrBuf[0] = '\0';
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
va_end( args );
|
||||||
|
return String::View{ Buffer, String::toUtf32( pmrBuf.data(), Buffer, BufferSize ) };
|
||||||
|
}
|
||||||
|
|
||||||
String::String() {}
|
String::String() {}
|
||||||
|
|
||||||
String::String( char ansiChar ) {
|
String::String( char ansiChar ) {
|
||||||
|
|||||||
@@ -317,11 +317,19 @@ TableView#locate_bar_table > tableview::row:selected > tableview::cell:nth-child
|
|||||||
background-color: rgba(0,0,0, 0.1);
|
background-color: rgba(0,0,0, 0.1);
|
||||||
}
|
}
|
||||||
.settings_panel .advanced_options .title {
|
.settings_panel .advanced_options .title {
|
||||||
padding-bottom: 4dp;
|
padding-right: 4dp;
|
||||||
border-radius: 4dp;
|
border-radius: 4dp;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
transition: background-color 100ms;
|
transition: background-color 100ms;
|
||||||
}
|
}
|
||||||
|
.settings_panel .advanced_options .title > * {
|
||||||
|
color: var(--font);
|
||||||
|
tint: var(--font);
|
||||||
|
}
|
||||||
|
.settings_panel .advanced_options .title:hover > * {
|
||||||
|
color: var(--list-row-active);
|
||||||
|
tint: var(--list-row-active);
|
||||||
|
}
|
||||||
.settings_panel .advanced_options .title:hover {
|
.settings_panel .advanced_options .title:hover {
|
||||||
background-color: var(--primary);
|
background-color: var(--primary);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user