Giter Club home page Giter Club logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
here is a diff...

$ diff winmain.c winmainx.c
765a766
>   "  -x, --center          Open window in center of screen\n"
780c781
< static const char short_opts[] = "+:HVuec:o:p:s:w:t:i:l:h:";
---
> static const char short_opts[] = "+:HVeuxc:o:p:s:w:t:i:l:h:";
787a789
>   {"center",   no_argument,       0, 'x'},
868a871
>   bool center = false;
901a905
>       when 'x': center = true;
1060a1065,1075
>
>   if (center) {
>     static RECT ss;
>     get_fullscreen_rect(&ss);
>     SetWindowPos(wnd, null,
>                  (ss.right - (term_width + extra_width + 2 * PADDING))/2,
>                  (ss.bottom - (term_height + extra_height + 2 * PADDING))/2,
>                  term_width + extra_width + 2 * PADDING,
>                  term_height + extra_height + 2 * PADDING,
>                  SWP_NOZORDER);
>   }

Original comment by [email protected] on 6 Aug 2010 at 4:08

from mintty.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
Good work, but no, I wouldn't want to add this as a separate option. However, I 
could imagine adding it as a special argument to the --position option, along 
with support for the four edges, so you could say something like 
'--position=right,top' or '-position=centre,centre'.

I'm not really convinced that this is necessary though, because the existing 
--position functionality already supports these use cases; it's just that it 
might require a bit of experimentation to find the right coordinates.

Original comment by andy.koppe on 6 Aug 2010 at 5:24

  • Changed title: Support special --position arguments for screen centre and edges
  • Changed state: Accepted
  • Added labels: Difficulty-Medium, Priority-Low

from mintty.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
I agree that adding to the existing -p option is better, my current c skills 
would not let me go there without actually looking something up!  This was for 
a script that gets kicked off after an install, so who knows what res screen it 
would run on, and folks wanted it centered like the installer that came before 
it.

Original comment by [email protected] on 6 Aug 2010 at 12:31

from mintty.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
Thanks, that's a valid new use case (although perhaps not a very common one).

Original comment by andy.koppe on 7 Aug 2010 at 6:02

from mintty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.