improve dialog and cloud browse icon text, deselect guide on mode leave
This commit is contained in:
@@ -918,10 +918,10 @@
|
||||
|
||||
<!-- DIALOG BROWSE -->
|
||||
<layout id="dialog-browse-item">
|
||||
<border dir="col" color=".4 .4 .4 .8" pad="4" height="120" width="100" margin="1 1 1 1" grow="1" align="center">
|
||||
<border dir="col" color=".4 .4 .4 .8" pad="4" height="100" width="100" margin="1 1 1 1" grow="1" align="center">
|
||||
<image-texture id="thumb-tex" width="100%" grow="1" height="1" aspect-ratio="1">
|
||||
<border positioning="absolute" color="0 0 0 .5" pad="2">
|
||||
<text id="title" text="File Name" margin="5 0 0 0" text-wrap-width="90"/>
|
||||
<border positioning="absolute" color="0 0 0 .5" pad="2" width="100%">
|
||||
<text id="title" text="File Name" text-wrap-width="85"/>
|
||||
</border>
|
||||
</image-texture>
|
||||
</border>
|
||||
@@ -951,9 +951,12 @@
|
||||
|
||||
<!-- DIALOG CLOUD BROWSE -->
|
||||
<layout id="dialog-cloud-item">
|
||||
<border dir="col" color=".4 .4 .4 .8" pad="4" height="120" width="100" margin="1 1 1 1" grow="1" align="center">
|
||||
<image-texture id="thumb-tex" width="100%" grow="1" height="1" aspect-ratio="1"/>
|
||||
<text id="title" text="File Name" margin="5 0 0 0"/>
|
||||
<border dir="col" color=".4 .4 .4 .8" pad="4" height="100" width="100" margin="1 1 1 1" grow="1" align="center">
|
||||
<image-texture id="thumb-tex" width="100%" grow="1" height="1" aspect-ratio="1">
|
||||
<border positioning="absolute" color="0 0 0 .5" pad="2" width="100%">
|
||||
<text id="title" text="File Name" text-wrap-width="85"/>
|
||||
</border>
|
||||
</image-texture>
|
||||
</border>
|
||||
</layout>
|
||||
<layout id="dialog-cloud">
|
||||
|
||||
@@ -345,7 +345,6 @@ public:
|
||||
template<typename T, typename R = std::result_of<T()>::type>
|
||||
std::future<R> ui_task_async(T task)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
std::packaged_task<R()> pt(task);
|
||||
std::future<R> f = pt.get_future();
|
||||
if (is_ui_thread())
|
||||
@@ -361,13 +360,11 @@ public:
|
||||
ui_cv.notify_all();
|
||||
}
|
||||
return f;
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
template<typename T, typename R = std::result_of<T()>::type>
|
||||
R ui_task(T task)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
std::packaged_task<R()> pt(task);
|
||||
std::future<R> f = pt.get_future();
|
||||
if (is_ui_thread())
|
||||
@@ -383,7 +380,6 @@ public:
|
||||
ui_cv.notify_all();
|
||||
}
|
||||
return ui_running ? f.get() : R();
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
void ui_sync()
|
||||
|
||||
@@ -3136,15 +3136,14 @@ Layer::Snapshot Layer::snapshot(std::array<glm::vec4, 6> * dirty_box /*= nullptr
|
||||
|
||||
snap.image[i] = std::make_unique<uint8_t[]>(m_rtt[i].bytes());
|
||||
|
||||
//glReadBuffer(GL_BACK);
|
||||
App::I.render_task_async([this,i,&snap]
|
||||
{
|
||||
m_rtt[i].bindFramebuffer();
|
||||
glm::vec2 box_sz = zw(snap.m_dirty_box[i]) - xy(snap.m_dirty_box[i]);
|
||||
glReadPixels(snap.m_dirty_box[i].x, snap.m_dirty_box[i].y, box_sz.x, box_sz.y, GL_RGBA, GL_UNSIGNED_BYTE, snap.image[i].get());
|
||||
glReadPixels(snap.m_dirty_box[i].x, snap.m_dirty_box[i].y,
|
||||
box_sz.x, box_sz.y, GL_RGBA, GL_UNSIGNED_BYTE, snap.image[i].get());
|
||||
m_rtt[i].unbindFramebuffer();
|
||||
});
|
||||
//glReadBuffer(GL_NONE);
|
||||
}
|
||||
App::I.render_sync();
|
||||
return snap;
|
||||
|
||||
@@ -565,6 +565,11 @@ void CanvasModeGrid::clear()
|
||||
m_lines.clear();
|
||||
}
|
||||
|
||||
void CanvasModeGrid::leave(kCanvasMode next)
|
||||
{
|
||||
m_selected_index = -1;
|
||||
}
|
||||
|
||||
void CanvasModeGrid::on_KeyEvent(KeyEvent* ke)
|
||||
{
|
||||
if ((ke->m_key == kKey::KeyBackspace || ke->m_key == kKey::KeyDel)
|
||||
|
||||
@@ -137,12 +137,13 @@ class CanvasModeGrid : public CanvasMode
|
||||
std::unique_ptr<class ActionModeGrid> m_action;
|
||||
public:
|
||||
bool m_highlight = false;
|
||||
int m_selected_index;
|
||||
int m_selected_index = -1;
|
||||
std::vector<ray_t> m_lines;
|
||||
virtual void on_MouseEvent(MouseEvent* me, glm::vec2& loc) override;
|
||||
virtual void on_KeyEvent(KeyEvent* ke) override;
|
||||
virtual void on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const glm::mat4& camera) override;
|
||||
virtual void init() override;
|
||||
virtual void leave(kCanvasMode next) override;
|
||||
void commit();
|
||||
void clear();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user