mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Text editor needs fixed-width font.
This commit is contained in:
parent
f3cc5cfd07
commit
5cd61c4b07
@ -294,7 +294,7 @@ enum { MinFrameSize = 5 };
|
|||||||
|
|
||||||
static View* s_instance = nullptr;
|
static View* s_instance = nullptr;
|
||||||
|
|
||||||
View::View( const char* addr )
|
View::View( const char* addr, ImFont* fixedWidth )
|
||||||
: m_worker( addr )
|
: m_worker( addr )
|
||||||
, m_staticView( false )
|
, m_staticView( false )
|
||||||
, m_frameScale( 0 )
|
, m_frameScale( 0 )
|
||||||
@ -330,6 +330,7 @@ View::View( const char* addr )
|
|||||||
, m_statSort( 0 )
|
, m_statSort( 0 )
|
||||||
, m_statSelf( false )
|
, m_statSelf( false )
|
||||||
, m_namespace( Namespace::Full )
|
, m_namespace( Namespace::Full )
|
||||||
|
, m_textEditorFont( fixedWidth )
|
||||||
{
|
{
|
||||||
assert( s_instance == nullptr );
|
assert( s_instance == nullptr );
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
@ -340,7 +341,7 @@ View::View( const char* addr )
|
|||||||
InitTextEditor();
|
InitTextEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
View::View( FileRead& f )
|
View::View( FileRead& f, ImFont* fixedWidth )
|
||||||
: m_worker( f )
|
: m_worker( f )
|
||||||
, m_staticView( true )
|
, m_staticView( true )
|
||||||
, m_frameScale( 0 )
|
, m_frameScale( 0 )
|
||||||
@ -375,6 +376,7 @@ View::View( FileRead& f )
|
|||||||
, m_statSort( 0 )
|
, m_statSort( 0 )
|
||||||
, m_statSelf( false )
|
, m_statSelf( false )
|
||||||
, m_namespace( Namespace::Full )
|
, m_namespace( Namespace::Full )
|
||||||
|
, m_textEditorFont( fixedWidth )
|
||||||
{
|
{
|
||||||
assert( s_instance == nullptr );
|
assert( s_instance == nullptr );
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "tracy_flat_hash_map.hpp"
|
#include "tracy_flat_hash_map.hpp"
|
||||||
|
|
||||||
struct ImVec2;
|
struct ImVec2;
|
||||||
|
struct ImFont;
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
@ -42,9 +43,9 @@ class View
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
View() : View( "127.0.0.1" ) {}
|
View( ImFont* fixedWidth = nullptr ) : View( "127.0.0.1", fixedWidth ) {}
|
||||||
View( const char* addr );
|
View( const char* addr, ImFont* fixedWidth = nullptr );
|
||||||
View( FileRead& f );
|
View( FileRead& f, ImFont* fixedWidth = nullptr );
|
||||||
~View();
|
~View();
|
||||||
|
|
||||||
static bool Draw();
|
static bool Draw();
|
||||||
@ -236,6 +237,7 @@ private:
|
|||||||
|
|
||||||
std::unique_ptr<TextEditor> m_textEditor;
|
std::unique_ptr<TextEditor> m_textEditor;
|
||||||
const char* m_textEditorFile;
|
const char* m_textEditorFile;
|
||||||
|
ImFont* m_textEditorFont;
|
||||||
|
|
||||||
struct FindZone {
|
struct FindZone {
|
||||||
enum : uint64_t { Unselected = std::numeric_limits<uint64_t>::max() - 1 };
|
enum : uint64_t { Unselected = std::numeric_limits<uint64_t>::max() - 1 };
|
||||||
|
Loading…
Reference in New Issue
Block a user