Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
ef00f675
Commit
ef00f675
authored
Jul 03, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed popup menu location
parent
1902e0b9
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
21 deletions
+29
-21
wb/lib/wb/qt/wb_wnav_qt.cqt
wb/lib/wb/qt/wb_wnav_qt.cqt
+6
-5
wb/lib/wb/qt/wb_wtt_qt.cqt
wb/lib/wb/qt/wb_wtt_qt.cqt
+3
-1
xtt/lib/cow/qt/cow_qt_helpers.cpp
xtt/lib/cow/qt/cow_qt_helpers.cpp
+9
-0
xtt/lib/cow/qt/cow_qt_helpers.h
xtt/lib/cow/qt/cow_qt_helpers.h
+2
-0
xtt/lib/cow/qt/cow_wow_qt.cqt
xtt/lib/cow/qt/cow_wow_qt.cqt
+8
-14
xtt/lib/flow/qt/flow_draw_qt.cqt
xtt/lib/flow/qt/flow_draw_qt.cqt
+1
-1
No files found.
wb/lib/wb/qt/wb_wnav_qt.cqt
View file @
ef00f675
...
@@ -79,6 +79,7 @@ extern "C" {
...
@@ -79,6 +79,7 @@ extern "C" {
#include <QColor>
#include <QColor>
#include <QInputDialog>
#include <QInputDialog>
#include <QScrollArea>
#include <QTimer>
#include <QTimer>
#include <QVBoxLayout>
#include <QVBoxLayout>
...
@@ -102,11 +103,11 @@ WNavQt::WNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid, const char *xn_name,
...
@@ -102,11 +103,11 @@ WNavQt::WNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid, const char *xn_name,
trace_obj = new WNavQtTraceObject(this);
trace_obj = new WNavQtTraceObject(this);
debug_print("creating a scrolledbrowwidgetqt\n");
QScrollArea *scrolledbrow = ((QScrollArea *)
QWidget *scrolledbrow =
scrolledbrowwidgetqt_new(WNav::init_brow_base_cb, this, &brow_widget));
scrolledbrowwidgetqt_new(WNav::init_brow_base_cb, this, &brow_widget);
scrolledbrow->setStyleSheet("QMainWindow{border: 3px solid black;}");
scrolledbrow->setFrameShape(QFrame::Box);
scrolledbrow->setLineWidth(3);
showNow(brow_widget);
showNow(brow_widget);
...
...
wb/lib/wb/qt/wb_wtt_qt.cqt
View file @
ef00f675
...
@@ -613,7 +613,8 @@ int WttQt::create_popup_menu(pwr_sAttrRef aref, int x, int y)
...
@@ -613,7 +613,8 @@ int WttQt::create_popup_menu(pwr_sAttrRef aref, int x, int y)
} else {
} else {
return 0;
return 0;
}
}
popupmenu_x += 10;
popupmenu_x += palette_paned->pos().x();
popupmenu_y += palette_paned->pos().y();
// Create the menu
// Create the menu
sts = get_popup_menu_items(aref, pwr_cNCid);
sts = get_popup_menu_items(aref, pwr_cNCid);
...
@@ -2560,6 +2561,7 @@ QMenu *WttQt::build_submenu(int MenuType, const char *MenuTitle,
...
@@ -2560,6 +2561,7 @@ QMenu *WttQt::build_submenu(int MenuType, const char *MenuTitle,
if (Items[idx].Item == ldh_eMenuItem_Cascade) {
if (Items[idx].Item == ldh_eMenuItem_Cascade) {
QMenu *sub = menu->addMenu(fl(Items[idx].Name));
QMenu *sub = menu->addMenu(fl(Items[idx].Name));
debug_print("build_submenu recursively calling build_submenu to add a submenu\n");
QMenu *w = build_submenu(MENU_PULLDOWN, Items[idx].Name, Callback, Items,
QMenu *w = build_submenu(MENU_PULLDOWN, Items[idx].Name, Callback, Items,
idx + 1);
idx + 1);
sub->addMenu(w);
sub->addMenu(w);
...
...
xtt/lib/cow/qt/cow_qt_helpers.cpp
View file @
ef00f675
...
@@ -77,6 +77,15 @@ void dbg_print(const char *file, int line, const char *fmt, ...)
...
@@ -77,6 +77,15 @@ void dbg_print(const char *file, int line, const char *fmt, ...)
}
}
}
}
void
dbg_print
(
QString
str
)
{
if
(
DEBUG
)
{
QByteArray
ba
=
str
.
toLocal8Bit
();
const
char
*
c_str
=
ba
.
data
();
fprintf
(
stderr
,
"%s
\n
"
,
c_str
);
}
}
QString
fl
(
const
char
*
text
)
QString
fl
(
const
char
*
text
)
{
{
return
QString
::
fromLocal8Bit
(
text
);
return
QString
::
fromLocal8Bit
(
text
);
...
...
xtt/lib/cow/qt/cow_qt_helpers.h
View file @
ef00f675
...
@@ -50,6 +50,8 @@ void print_time(FILE *stream, int fulldate = 0);
...
@@ -50,6 +50,8 @@ void print_time(FILE *stream, int fulldate = 0);
void
dbg_print
(
const
char
*
file
,
int
line
,
const
char
*
fmt
,
...);
void
dbg_print
(
const
char
*
file
,
int
line
,
const
char
*
fmt
,
...);
void
dbg_print
(
QString
str
);
#define debug_print(fmt, args...) \
#define debug_print(fmt, args...) \
do { if (DEBUG) { dbg_print(__FILE__, __LINE__, fmt, ##args); } } while (0)
do { if (DEBUG) { dbg_print(__FILE__, __LINE__, fmt, ##args); } } while (0)
...
...
xtt/lib/cow/qt/cow_wow_qt.cqt
View file @
ef00f675
...
@@ -587,31 +587,25 @@ void CoWowQt::PopupPosition(QWidget *parent, int x_event, int y_event, int *x,
...
@@ -587,31 +587,25 @@ void CoWowQt::PopupPosition(QWidget *parent, int x_event, int y_event, int *x,
int x1 = 0;
int x1 = 0;
int y1 = 0;
int y1 = 0;
int x0 = (int) x_event;
QPoint p0((int) x_event, (int) y_event);
int y0 = (int) y_event;
grandparent = parent->parentWidget();
grandparent = parent->parentWidget();
while (!grandparent->isWindow()) {
while (!grandparent->isWindow()) {
if (!x1 && !y1 && (parent->pos().x() || parent->pos().y())) {
if ( !x1 && !y1 && (parent->geometry().x() || parent->geometry().y())) {
// Add first widget with nonzero position
x1 = parent->geometry().x();
x1 = parent->pos().x();
y1 = parent->geometry().y();
y1 = parent->pos().y();
p0 = parent->mapToParent(p0);
x0 += x1;
y0 += y1;
}
}
parent = grandparent;
parent = grandparent;
grandparent = parent->parentWidget();
grandparent = parent->parentWidget();
}
}
if (grandparent) {
if (grandparent) {
// Add window widget position
// Add window widget position
x1 = grandparent->pos().x();
p0 = grandparent->mapToParent(p0);
y1 = grandparent->pos().y();
x0 += x1;
y0 += y1;
}
}
*x =
x0
;
*x =
p0.x()
;
*y =
y0
;
*y =
p0.y()
;
}
}
//
//
...
...
xtt/lib/flow/qt/flow_draw_qt.cqt
View file @
ef00f675
...
@@ -395,7 +395,7 @@ int FlowDrawQt::event_handler(QEvent *event)
...
@@ -395,7 +395,7 @@ int FlowDrawQt::event_handler(QEvent *event)
}
}
case QEvent::MouseButtonPress: {
case QEvent::MouseButtonPress: {
QMouseEvent *mouseEvent = ((QMouseEvent *) event);
QMouseEvent *mouseEvent = ((QMouseEvent *) event);
debug_print("event_handler: MouseButtonPress button=%d
\n", mouseEvent->button
());
debug_print("event_handler: MouseButtonPress button=%d
, x=%d, y=%d, globalX=%d, globalY=%d\n", mouseEvent->button(), mouseEvent->x(), mouseEvent->y(), mouseEvent->globalX(), mouseEvent->globalY
());
switch (mouseEvent->button()) {
switch (mouseEvent->button()) {
case Qt::LeftButton:
case Qt::LeftButton:
basectx->event_handler(flow_eEvent_MB1Down, mouseEvent->x(),
basectx->event_handler(flow_eEvent_MB1Down, mouseEvent->x(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment