improve quick panel and fix alt+tab
This commit is contained in:
@@ -1472,16 +1472,16 @@ Here's a list of what's available in this release.
|
|||||||
<!-- PANEL QUICK -->
|
<!-- PANEL QUICK -->
|
||||||
<layout id="tpl-panel-quick">
|
<layout id="tpl-panel-quick">
|
||||||
<border color="0 0 0 0.6" width="80" dir="col" pad="5" align="center" mouse-capture="true" shrink="1">
|
<border color="0 0 0 0.6" width="80" dir="col" pad="5" align="center" mouse-capture="true" shrink="1">
|
||||||
<node dir="row" pad="5">
|
<node dir="row" pad="5" shrink="1" min-height="100" max-height="150">
|
||||||
<!--size-->
|
<!--size-->
|
||||||
<node dir="col" margin="0 4 0 0" align="center">
|
<node dir="col" margin="0 4 0 0" align="center">
|
||||||
<text text="Size" margin="0 0 10 0"/>
|
<text text="Size" margin="0 0 10 0"/>
|
||||||
<slider-v id="quick-size" height="150" width="30"/>
|
<slider-v id="quick-size" height="100%" width="30"/>
|
||||||
</node>
|
</node>
|
||||||
<!--flow-->
|
<!--flow-->
|
||||||
<node dir="col" align="center">
|
<node dir="col" align="center">
|
||||||
<text text="Flow" margin="0 0 10 0"/>
|
<text text="Flow" margin="0 0 10 0"/>
|
||||||
<slider-v id="quick-flow" height="150" width="30"/>
|
<slider-v id="quick-flow" height="100%" width="30"/>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<!--color-->
|
<!--color-->
|
||||||
@@ -1605,7 +1605,7 @@ Here's a list of what's available in this release.
|
|||||||
<!-- central row -->
|
<!-- central row -->
|
||||||
<node grow="1" dir="row" wrap="1" height="0" id="central-row">
|
<node grow="1" dir="row" wrap="1" height="0" id="central-row">
|
||||||
<border color="0 0 0 0.6" pad="0 5 0 0" justify="center" dir="col" flood-events="1" mouse-capture="true">
|
<border color="0 0 0 0.6" pad="0 5 0 0" justify="center" dir="col" flood-events="1" mouse-capture="true">
|
||||||
<node margin="0 0 50 0" wrap="1" >
|
<node margin="0 0 55 0" wrap="1" >
|
||||||
<button-custom id="btn-pen" width="40" height="40" margin="2 0 2 5" thickness="1" border-color="0 0 0 1" pad="2">
|
<button-custom id="btn-pen" width="40" height="40" margin="2 0 2 5" thickness="1" border-color="0 0 0 1" pad="2">
|
||||||
<image path="data/ui/pen.png" width="100%" height="100%" align="center" justify="flex-end"/>
|
<image path="data/ui/pen.png" width="100%" height="100%" align="center" justify="flex-end"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
@@ -1644,8 +1644,9 @@ Here's a list of what's available in this release.
|
|||||||
</border>
|
</border>
|
||||||
|
|
||||||
<!--quick bar-->
|
<!--quick bar-->
|
||||||
<node justify="center" align="center">
|
<node justify="center" align="center" dir="col">
|
||||||
<panel-quick id="panel-quick"/>
|
<panel-quick id="panel-quick"/>
|
||||||
|
<node height="0" grow="1" max-height="50"/>
|
||||||
</node>
|
</node>
|
||||||
|
|
||||||
<!-- timeline -->
|
<!-- timeline -->
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ void init_vk_map()
|
|||||||
{
|
{
|
||||||
for (int vk = 0; vk < 256; vk++)
|
for (int vk = 0; vk < 256; vk++)
|
||||||
{
|
{
|
||||||
if (k == (int)convert_key(k))
|
if (k == (int)convert_key(vk))
|
||||||
{
|
{
|
||||||
if (vkey_map.find((kKey)k) == vkey_map.end())
|
if (vkey_map.find((kKey)k) == vkey_map.end())
|
||||||
{
|
{
|
||||||
@@ -891,11 +891,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
|
|||||||
static BYTE keys[256];
|
static BYTE keys[256];
|
||||||
if (GetKeyboardState(keys))
|
if (GetKeyboardState(keys))
|
||||||
{
|
{
|
||||||
bool alt = keys[VK_TAB] & 0x80;
|
bool alt = keys[VK_MENU] & 0x80;
|
||||||
for (auto k : vkey_map)
|
for (auto k : vkey_map)
|
||||||
{
|
{
|
||||||
// ignore alt + tab
|
// ignore alt + tab
|
||||||
if (alt && k.first == kKey::KeyAlt)
|
if (alt && k.first == kKey::KeyTab)
|
||||||
continue;
|
continue;
|
||||||
bool down = keys[k.second] & 0x80;
|
bool down = keys[k.second] & 0x80;
|
||||||
if (App::I.keys[(int)k.first] && !down)
|
if (App::I.keys[(int)k.first] && !down)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void NodePanelQuick::init_controls()
|
|||||||
m_slider_size = find<NodeSliderV>("quick-size");
|
m_slider_size = find<NodeSliderV>("quick-size");
|
||||||
m_slider_size->on_value_changed = [this](Node* target, float value) {
|
m_slider_size->on_value_changed = [this](Node* target, float value) {
|
||||||
auto m = static_cast<CanvasModePen*>(Canvas::I->modes[(int)kCanvasMode::Draw][0]);
|
auto m = static_cast<CanvasModePen*>(Canvas::I->modes[(int)kCanvasMode::Draw][0]);
|
||||||
m->m_cur_pos = (m_slider_flow->m_pos + glm::vec2(100.F, 75.f)) * App::I.zoom;
|
m->m_cur_pos = (m_slider_flow->m_pos + glm::vec2(100.f, m_slider_flow->m_size.y / 2.f)) * App::I.zoom;
|
||||||
m_button_brush_current_preview->draw_stroke();
|
m_button_brush_current_preview->draw_stroke();
|
||||||
if (on_size_change)
|
if (on_size_change)
|
||||||
on_size_change(target, value);
|
on_size_change(target, value);
|
||||||
@@ -50,7 +50,7 @@ void NodePanelQuick::init_controls()
|
|||||||
m_slider_flow = find<NodeSliderV>("quick-flow");
|
m_slider_flow = find<NodeSliderV>("quick-flow");
|
||||||
m_slider_flow->on_value_changed = [this](Node* target, float value) {
|
m_slider_flow->on_value_changed = [this](Node* target, float value) {
|
||||||
auto m = static_cast<CanvasModePen*>(Canvas::I->modes[(int)kCanvasMode::Draw][0]);
|
auto m = static_cast<CanvasModePen*>(Canvas::I->modes[(int)kCanvasMode::Draw][0]);
|
||||||
m->m_cur_pos = (m_slider_flow->m_pos + glm::vec2(100.F, 75.f)) * App::I.zoom;
|
m->m_cur_pos = (m_slider_flow->m_pos + glm::vec2(100.f, m_slider_flow->m_size.y / 2.f)) * App::I.zoom;
|
||||||
m_button_brush_current_preview->draw_stroke();
|
m_button_brush_current_preview->draw_stroke();
|
||||||
if (on_flow_change)
|
if (on_flow_change)
|
||||||
on_flow_change(target, value);
|
on_flow_change(target, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user