Renamed "Two Pages" to "Paired Pages" to reflect new behaviour.

presentation
JJones780 7 years ago
parent 6eef97d355
commit a578c992a8
  1. 14
      src/control/Control.cpp
  2. 2
      src/control/Control.h
  3. 18
      src/control/settings/Settings.cpp
  4. 6
      src/control/settings/Settings.h
  5. 2
      src/enums/ActionGroup.enum.h
  6. 2
      src/enums/ActionType.enum.h
  7. 8
      src/enums/generated/ActionGroup.generated.cpp
  8. 8
      src/enums/generated/ActionType.generated.cpp
  9. 8
      src/gui/Layout.cpp
  10. 4
      src/gui/toolbarMenubar/ToolMenuHandler.cpp
  11. 4
      src/gui/toolbarMenubar/model/ToolbarModel.cpp
  12. 4
      ui/main.glade
  13. 0
      ui/pixmaps/showpairedpages.svg
  14. 10
      ui/toolbar.ini

@ -354,7 +354,7 @@ void Control::initWindow(MainWindow* win)
setViewTwoPages(settings->isShowTwoPages());
setViewPairedPages(settings->isShowPairedPages());
setViewPresentationMode(settings->isPresentationMode());
penSizeChanged();
@ -838,8 +838,8 @@ void Control::actionPerformed(ActionType type, ActionGroup group, GdkEvent* even
});
break;
case ACTION_VIEW_TWO_PAGES:
setViewTwoPages(enabled);
case ACTION_VIEW_PAIRED_PAGES:
setViewPairedPages(enabled);
break;
case ACTION_VIEW_PRESENTATION_MODE:
@ -1499,12 +1499,12 @@ void Control::zoomFit()
zoom->zoomFit();
}
void Control::setViewTwoPages(bool twoPages)
void Control::setViewPairedPages(bool pairedPages)
{
XOJ_CHECK_TYPE(Control);
settings->setShowTwoPages(twoPages);
fireActionSelected(GROUP_TWOPAGES, twoPages ? ACTION_VIEW_TWO_PAGES : ACTION_NOT_SELECTED);
settings->setShowPairedPages(pairedPages);
fireActionSelected(GROUP_PAIRED_PAGES, pairedPages ? ACTION_VIEW_PAIRED_PAGES : ACTION_NOT_SELECTED);
int currentPage = getCurrentPageNo();
win->getXournal()->layoutPages();
@ -1528,7 +1528,7 @@ void Control::setPairsOffset(int numOffset)
XOJ_CHECK_TYPE(Control);
settings->setPairsOffset(numOffset);
fireActionSelected(GROUP_TWOPAGES, numOffset ? ACTION_SET_PAIRS_OFFSET: ACTION_NOT_SELECTED);
fireActionSelected(GROUP_PAIRED_PAGES, numOffset ? ACTION_SET_PAIRS_OFFSET: ACTION_NOT_SELECTED);
int currentPage = getCurrentPageNo();
win->getXournal()->layoutPages();
scrollHandler->scrollToPage(currentPage);

@ -126,7 +126,7 @@ public:
void updateWindowTitle();
void calcZoomFitSize();
void setViewTwoPages(bool continous);
void setViewPairedPages(bool continous);
void setViewPresentationMode(bool continous);
void setPairsOffset(int numOffset);
void setViewColumns(int numColumns);

@ -45,7 +45,7 @@ void Settings::loadDefault()
this->presureSensitivity = true;
this->zoomGesturesEnabled = true;
this->maximized = false;
this->showTwoPages = false;
this->showPairedPages = false;
this->presentationMode = false;
this->numColumns = 1;
@ -350,9 +350,9 @@ void Settings::parseItem(xmlDocPtr doc, xmlNodePtr cur)
{
this->layoutBottomToTop = xmlStrcmp(value, (const xmlChar*) "true") ? false : true;
}
else if (xmlStrcmp(name, (const xmlChar*) "showTwoPages") == 0)
else if (xmlStrcmp(name, (const xmlChar*) "showPairedPages") == 0)
{
this->showTwoPages = xmlStrcmp(value, (const xmlChar*) "true") ? false : true;
this->showPairedPages = xmlStrcmp(value, (const xmlChar*) "true") ? false : true;
}
else if (xmlStrcmp(name, (const xmlChar*) "numPairsOffset") == 0)
{
@ -770,7 +770,7 @@ void Settings::save()
WRITE_BOOL_PROP(sidebarOnRight);
WRITE_BOOL_PROP(scrollbarOnLeft);
WRITE_INT_PROP(numColumns);
WRITE_BOOL_PROP(showTwoPages);
WRITE_BOOL_PROP(showPairedPages);
WRITE_BOOL_PROP(layoutVertical);
WRITE_BOOL_PROP(layoutRightToLeft);
WRITE_BOOL_PROP(layoutBottomToTop);
@ -1376,24 +1376,24 @@ void Settings::setSizeUnitIndex(int sizeUnitId)
setSizeUnit(XOJ_UNITS[sizeUnitId].name);
}
void Settings::setShowTwoPages(bool showTwoPages)
void Settings::setShowPairedPages(bool showPairedPages)
{
XOJ_CHECK_TYPE(Settings);
if (this->showTwoPages == showTwoPages)
if (this->showPairedPages == showPairedPages)
{
return;
}
this->showTwoPages = showTwoPages;
this->showPairedPages = showPairedPages;
save();
}
bool Settings::isShowTwoPages()
bool Settings::isShowPairedPages()
{
XOJ_CHECK_TYPE(Settings);
return this->showTwoPages;
return this->showPairedPages;
}
void Settings::setPresentationMode(bool presentationMode)

@ -216,8 +216,8 @@ public:
double getWidthMinimumMultiplier();
double getWidthMaximumMultiplier();
void setShowTwoPages(bool showTwoPages);
bool isShowTwoPages();
void setShowPairedPages(bool showPairedPages);
bool isShowPairedPages();
void setPresentationMode(bool presentationMode);
bool isPresentationMode();
@ -484,7 +484,7 @@ private:
/**
* Pairs pages
*/
bool showTwoPages;
bool showPairedPages;
/**
* Sets presentation mode

@ -41,7 +41,7 @@ enum ActionGroup
// Need group for toggle button, this is the first Toggle Group
GROUP_TOGGLE_GROUP,
GROUP_TWOPAGES,
GROUP_PAIRED_PAGES,
GROUP_PRESENTATION_MODE,
GROUP_FULLSCREEN,

@ -150,7 +150,7 @@ enum ActionType
ACTION_ZOOM_FIT,
ACTION_ZOOM_100,
ACTION_FULLSCREEN,
ACTION_VIEW_TWO_PAGES,
ACTION_VIEW_PAIRED_PAGES,
ACTION_VIEW_PRESENTATION_MODE,
ACTION_MANAGE_TOOLBAR,
ACTION_CUSTOMIZE_TOOLBAR,

@ -72,9 +72,9 @@ ActionGroup ActionGroup_fromString(string value)
return GROUP_TOGGLE_GROUP;
}
if (value == "GROUP_TWOPAGES")
if (value == "GROUP_PAIRED_PAGES")
{
return GROUP_TWOPAGES;
return GROUP_PAIRED_PAGES;
}
if (value == "GROUP_PRESENTATION_MODE")
@ -200,9 +200,9 @@ string ActionGroup_toString(ActionGroup value)
return "GROUP_TOGGLE_GROUP";
}
if (value == GROUP_TWOPAGES)
if (value == GROUP_PAIRED_PAGES)
{
return "GROUP_TWOPAGES";
return "GROUP_PAIRED_PAGES";
}
if (value == GROUP_PRESENTATION_MODE)

@ -492,9 +492,9 @@ ActionType ActionType_fromString(string value)
return ACTION_FULLSCREEN;
}
if (value == "ACTION_VIEW_TWO_PAGES")
if (value == "ACTION_VIEW_PAIRED_PAGES")
{
return ACTION_VIEW_TWO_PAGES;
return ACTION_VIEW_PAIRED_PAGES;
}
if (value == "ACTION_VIEW_PRESENTATION_MODE")
@ -1110,9 +1110,9 @@ string ActionType_toString(ActionType value)
return "ACTION_FULLSCREEN";
}
if (value == ACTION_VIEW_TWO_PAGES)
if (value == ACTION_VIEW_PAIRED_PAGES)
{
return "ACTION_VIEW_TWO_PAGES";
return "ACTION_VIEW_PAIRED_PAGES";
}
if (value == ACTION_VIEW_PRESENTATION_MODE)

@ -65,11 +65,11 @@ void Layout::updateCurrentPage()
Control* control = this->view->getControl();
bool twoPages = control->getSettings()->isShowTwoPages();
bool pairedPages = control->getSettings()->isShowPairedPages();
if (visRect.y < 1)
{
if (twoPages && this->view->viewPagesLen > 1 &&
if (pairedPages && this->view->viewPagesLen > 1 &&
this->view->viewPages[1]->isSelected())
{
// page 2 already selected
@ -126,7 +126,7 @@ void Layout::updateCurrentPage()
}
}
if (twoPages && mostPageNr < this->view->viewPagesLen - 1)
if (pairedPages && mostPageNr < this->view->viewPagesLen - 1)
{
int y1 = this->view->viewPages[mostPageNr]->getY();
int y2 = this->view->viewPages[mostPageNr + 1]->getY();
@ -200,7 +200,7 @@ void Layout::layoutPages()
Settings* settings = this->view->getControl()->getSettings();
bool verticalSpace = settings->getAddVerticalSpace(); //TODO: Use these again
bool horizontalSpace = settings->getAddHorizontalSpace(); //TODO: Use these again
bool isPairedPages = settings->isShowTwoPages();
bool isPairedPages = settings->isShowPairedPages();
int numRowsOrColumns = settings->getViewColumns();
int pairsOffset = settings->getPairsOffset();
bool vert = settings->getViewLayoutVert();

@ -413,8 +413,8 @@ void ToolMenuHandler::initToolItems()
// Menu View
// ************************************************************************
ADD_CUSTOM_ITEM_TGL("TWO_PAGES", ACTION_VIEW_TWO_PAGES, GROUP_TWOPAGES, false, "showtwopages.svg", _("Two pages"));
ADD_CUSTOM_ITEM_TGL("PRESENTATION_MODE", ACTION_VIEW_PRESENTATION_MODE, GROUP_PRESENTATION_MODE, false, "showtwopages.svg", _("Presentation mode"));
ADD_CUSTOM_ITEM_TGL("PAIRED_PAGES", ACTION_VIEW_PAIRED_PAGES, GROUP_PAIRED_PAGES, false, "showpairedpages.svg", _("Paired pages"));
ADD_CUSTOM_ITEM_TGL("PRESENTATION_MODE", ACTION_VIEW_PRESENTATION_MODE, GROUP_PRESENTATION_MODE, false, "showpairedpages.svg", _("Presentation mode"));
ADD_CUSTOM_ITEM_TGL("FULLSCREEN", ACTION_FULLSCREEN, GROUP_FULLSCREEN, false, "fullscreen.svg", _("Toggle fullscreen"));
ADD_STOCK_ITEM("ZOOM_OUT", ACTION_ZOOM_OUT, "zoom-out", _("Zoom out"));

@ -145,7 +145,7 @@ bool ToolbarModel::existsId(string id)
const char* TOOLBAR_INI_HEADER =
"# Xournal++ Toolbar configuration\n"
"# Here you can customize the Toolbars\n"
" Delte this file to generate a new config file with default values\n"
" Delete this file to generate a new config file with default values\n"
"\n"
" Available buttons:\n"
" File: NEW,SAVE,OPEN\n"
@ -154,7 +154,7 @@ const char* TOOLBAR_INI_HEADER =
"\n"
" Navigation: GOTO_FIRST,GOTO_BACK,GOTO_NEXT,GOTO_LAST,GOTO_NEXT_ANNOTATED_PAGE\n"
"\n"
" Zoom: ZOOM_OUT,ZOOM_IN,ZOOM_FIT,ZOOM_100,FULLSCREEN,TWO_PAGES\n"
" Zoom: ZOOM_OUT,ZOOM_IN,ZOOM_FIT,ZOOM_100,FULLSCREEN,PAIRED_PAGES\n"
"\n"
" Color: COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT\n"
" Notice: This are the default Xournal colors, each other color in HEX can also be used, eg COLOR(0x12ABCF);\n"

@ -312,12 +312,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckMenuItem" id="menuViewTwoPages">
<object class="GtkCheckMenuItem" id="menuViewPairedPages">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Pair Pages</property>
<property name="use_underline">True</property>
<signal name="toggled" handler="ACTION_VIEW_TWO_PAGES" swapped="no"/>
<signal name="toggled" handler="ACTION_VIEW_PAIRED_PAGES" swapped="no"/>
</object>
</child>
<child>

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

@ -12,7 +12,7 @@
#
# Navigation: GOTO_FIRST,GOTO_BACK,GOTO_NEXT,GOTO_LAST,GOTO_NEXT_ANNOTATED_PAGE
#
# Zoom: ZOOM_OUT,ZOOM_IN,ZOOM_FIT,ZOOM_100,FULLSCREEN,TWO_PAGES
# Zoom: ZOOM_OUT,ZOOM_IN,ZOOM_FIT,ZOOM_100,FULLSCREEN,PAIRED_PAGES
#
# Color: COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT
# Notice: This are the default Xournal colors, each other color in HEX can also be used, eg COLOR(0x12ABCF);
@ -37,14 +37,14 @@ name[de] = Hochformat
name[it] = Ritratto
toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, GOTO_FIRST,GOTO_BACK,GOTO_NEXT_ANNOTATED_PAGE,GOTO_NEXT,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SEPARATOR ,FULLSCREEN,SEPARATOR, RECSTOP,SEPARATOR, SELECT_FONT
toolbarTop2 = PEN,ERASER,HILIGHTER,IMAGE,TEXT,DRAW,SEPARATOR, ROTATION_SNAPPING,GRID_SNAPPING,SEPARATOR, SELECT,VERTICAL_SPACE,HAND,SEPARATOR, DEFAULT_TOOL,SEPARATOR, FINE,MEDIUM,THICK,SEPARATOR,TOOL_FILL,SEPARATOR,COLOR(0x000000),COLOR(0x008000),COLOR(0x00c0ff),COLOR(0x00ff00),COLOR(0x3333cc),COLOR(0x808080),COLOR(0xff0000),COLOR(0xff00ff),COLOR(0xff8000),COLOR(0xffff00),COLOR(0xffffff),COLOR_SELECT
toolbarBottom1 = PAGE_SPIN,SEPARATOR,LAYER, SPACER, TWO_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN
toolbarBottom1 = PAGE_SPIN,SEPARATOR,LAYER, SPACER, PAIRED_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN
[Xournal++]
name = Xournal++
name[de] = Xournal++
name[it] = Xournal++
toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, PEN,ERASER,HILIGHTER,IMAGE,TEXT,DRAW,SEPARATOR, SELECT,VERTICAL_SPACE,HAND,SEPARATOR, FINE,MEDIUM,THICK,SEPARATOR,TOOL_FILL,SEPARATOR ,COLOR(0x000000),COLOR(0x008000),COLOR(0x00c0ff),COLOR(0x00ff00),COLOR(0x3333cc),COLOR(0x808080),COLOR(0xff0000),COLOR(0xff00ff),COLOR(0xff8000),COLOR(0xffff00),COLOR(0xffffff),COLOR_SELECT, SEPARATOR, SELECT_FONT
toolbarBottom1 = PAGE_SPIN,SEPARATOR,LAYER,GOTO_FIRST,GOTO_NEXT_ANNOTATED_PAGE,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SPACER, TWO_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN,SEPARATOR, FULLSCREEN
toolbarBottom1 = PAGE_SPIN,SEPARATOR,LAYER,GOTO_FIRST,GOTO_NEXT_ANNOTATED_PAGE,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SPACER, PAIRED_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN,SEPARATOR, FULLSCREEN
[Right hand Note Taking]
toolbarTop1=SAVE,NEW,OPEN,SEPARATOR,CUT,COPY,PASTE,SEPARATOR,UNDO,REDO,SEPARATOR,PEN,ERASER,HILIGHTER,IMAGE,TEXT,SEPARATOR,DEFAULT_TOOL,SEPARATOR,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SEPARATOR,GOTO_BACK,GOTO_NEXT,SEPARATOR,FULLSCREEN,SEPARATOR,RECSTOP
@ -57,7 +57,7 @@ name[it] = Appunti per Destrorsi
name = Toolbar Left
name[it] = Barra a Sinistra
toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, PEN,ERASER,HILIGHTER,IMAGE,TEXT,DRAW,SEPARATOR, SELECT,VERTICAL_SPACE,HAND,SEPARATOR, DEFAULT_TOOL,SEPARATOR, PAGE_SPIN,SEPARATOR, GOTO_FIRST,GOTO_NEXT_ANNOTATED_PAGE,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SEPARATOR, LAYER,FULLSCREEN
toolbarLeft1 = COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT,SEPARATOR, FINE,MEDIUM,THICK, SEPARATOR,TWO_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN
toolbarLeft1 = COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT,SEPARATOR, FINE,MEDIUM,THICK, SEPARATOR,PAIRED_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN
[Toolbar Right]
@ -65,7 +65,7 @@ name = Toolbar Right
name[de] = Toolbar Rechts
name[it] = Barra a Destra
toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, PEN,ERASER,HILIGHTER,IMAGE,TEXT,DRAW,SEPARATOR, SELECT,VERTICAL_SPACE,HAND,SEPARATOR, DEFAULT_TOOL,SEPARATOR, PAGE_SPIN,SEPARATOR, GOTO_FIRST,GOTO_NEXT_ANNOTATED_PAGE,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SEPARATOR, LAYER,FULLSCREEN
toolbarRight1 = COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT,SEPARATOR, FINE,MEDIUM,THICK, SEPARATOR,TWO_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN
toolbarRight1 = COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT,SEPARATOR, FINE,MEDIUM,THICK, SEPARATOR,PAIRED_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN
[Empty Toolbar]
name = Empty Toolbar

Loading…
Cancel
Save